Subversion Repositories oidplus

Rev

Rev 13 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13 Rev 24
Line 237... Line 237...
237
                        $row = OIDplus::db()->fetch_array($res);
237
                        $row = OIDplus::db()->fetch_array($res);
238
                        $current_ra = $row['ra_email'];
238
                        $current_ra = $row['ra_email'];
239
 
239
 
240
                        if ($new_ra != $current_ra) _ra_change_rec($id, $current_ra, $new_ra); // Inherited RAs rekursiv mitändern
240
                        if ($new_ra != $current_ra) _ra_change_rec($id, $current_ra, $new_ra); // Inherited RAs rekursiv mitändern
241
 
241
 
-
 
242
                        // Replace ASN.1 und IRI IDs
242
                        if ($obj::ns() == 'oid') {
243
                        if ($obj::ns() == 'oid') {
243
                                $oid = $obj;
244
                                $oid = $obj;
244
 
245
 
245
                                $ids = ($_POST['iris'] == '') ? array() : explode(',',$_POST['iris']);
246
                                $ids = ($_POST['iris'] == '') ? array() : explode(',',$_POST['iris']);
246
                                $ids = array_map('trim',$ids);
247
                                $ids = array_map('trim',$ids);
Line 287... Line 288...
287
                        $objParent = OIDplusObject::parse($_POST['parent']);
288
                        $objParent = OIDplusObject::parse($_POST['parent']);
288
                        if (!$objParent->userHasWriteRights()) die('Authentification error. Please log in as the correct RA to insert an OID at this arc.');
289
                        if (!$objParent->userHasWriteRights()) die('Authentification error. Please log in as the correct RA to insert an OID at this arc.');
289
 
290
 
290
                        // Check if the ID is valid
291
                        // Check if the ID is valid
291
                        if ($_POST['id'] == '') die('ID may not be empty');
292
                        if ($_POST['id'] == '') die('ID may not be empty');
292
                        if ($objParent::ns() == 'oid') {
-
 
293
                                // TODO: Make a function in the object type class for the ID validation
-
 
294
                                //       Then, we can also validate non-OID types, too.
-
 
295
                                $numeric_arc = $_POST['id'];
-
 
296
                                if ($numeric_arc == '') die('ID may not be empty');
-
 
297
                                if (!$objParent->isRoot() && !is_numeric($numeric_arc)) die('ID must be a number');
-
 
298
                                #if ($numeric_arc < 0) die('ID may not be negative!');
-
 
299
                                #if ((substr($numeric_arc,0,1) == '0') && ($numeric_arc != '0')) die('ID may not have leading zeros');
-
 
300
                        }
-
 
301
 
293
 
302
                        // Absoluten OID namen bestimmen
294
                        // Absoluten OID namen bestimmen
303
                        if ($parent = OIDplusObject::parse($_POST['parent'])) $id = $parent->addString($_POST['id']);
295
                        // Note: At addString() and parse(), the syntax of the ID will be checked
304
                        if (is_null($parent)) throw new Exception("Type of ".$_POST['parent']." unknown");
296
                        $id = $objParent->addString($_POST['id']);
305
                        $obj = OIDplusObject::parse($id);
297
                        $obj = OIDplusObject::parse($id);
306
 
298
 
307
                        // Superior RA Änderung durchführen
299
                        // Superior RA Änderung durchführen
308
                        $parent = $_POST['parent'];
300
                        $parent = $_POST['parent'];
309
                        $ra_email = $_POST['ra_email'];
301
                        $ra_email = $_POST['ra_email'];