Rev 1219 | Rev 1261 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1219 | Rev 1259 | ||
---|---|---|---|
Line 317... | Line 317... | ||
317 | return array("status" => 0); |
317 | return array("status" => 0); |
318 | } |
318 | } |
319 | 319 | ||
320 | // Generate UUID |
320 | // Generate UUID |
321 | else if ($actionID == 'generate_uuid') { |
321 | else if ($actionID == 'generate_uuid') { |
322 | $uuid = gen_uuid(); |
322 | $uuid = gen_uuid(OIDplus::config()->getValue('uuid_prefer_timebased', '1') == '1'); |
323 | if (!$uuid) return array("status" => 1); |
323 | if (!$uuid) return array("status" => 1); |
324 | return array( |
324 | return array( |
325 | "status" => 0, |
325 | "status" => 0, |
326 | "uuid" => $uuid, |
326 | "uuid" => $uuid, |
327 | "intval" => substr(uuid_to_oid($uuid),strlen('2.25.')) |
327 | "intval" => substr(uuid_to_oid($uuid),strlen('2.25.')) |
Line 499... | Line 499... | ||
499 | OIDplus::config()->prepareConfigKey('oid_grid_show_weid', 'Show WEID/Base36 column in CRUD grid of OIDs?', '1', OIDplusConfig::PROTECTION_EDITABLE, function($value) { |
499 | OIDplus::config()->prepareConfigKey('oid_grid_show_weid', 'Show WEID/Base36 column in CRUD grid of OIDs?', '1', OIDplusConfig::PROTECTION_EDITABLE, function($value) { |
500 | if (!is_numeric($value) || ($value < 0) || ($value > 1)) { |
500 | if (!is_numeric($value) || ($value < 0) || ($value > 1)) { |
501 | throw new OIDplusException(_L('Please enter a valid value (0=no, 1=yes).')); |
501 | throw new OIDplusException(_L('Please enter a valid value (0=no, 1=yes).')); |
502 | } |
502 | } |
503 | }); |
503 | }); |
- | 504 | OIDplus::config()->prepareConfigKey('uuid_prefer_timebased', 'Preferred UUID Generator version? 1=Timebased (Very secure, but reveals the MAC address of the server); 4=Random (has a very, very tiny change to generate duplicates)', '1', OIDplusConfig::PROTECTION_HIDDEN, function($value) { |
|
- | 505 | if (($value != '1') && ($value != '4')) { |
|
- | 506 | throw new OIDplusException(_L('Please enter a valid value (1=Timebased, 4=Random).')); |
|
- | 507 | } |
|
- | 508 | }); |
|
504 | } |
509 | } |
505 | 510 | ||
506 | /** |
511 | /** |
507 | * @param string $id |
512 | * @param string $id |
508 | * @param array $out |
513 | * @param array $out |
Line 1017... | Line 1022... | ||
1017 | } |
1022 | } |
1018 | 1023 | ||
1019 | $enable_weid_presentation = OIDplus::config()->getValue('oid_grid_show_weid'); |
1024 | $enable_weid_presentation = OIDplus::config()->getValue('oid_grid_show_weid'); |
1020 | 1025 | ||
1021 | $output = '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
1026 | $output = '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
1022 | $output .= '<table class="table table-bordered table-striped">'; |
1027 | $output .= '<table id="crudTable" class="table table-bordered table-striped">'; |
1023 | $output .= '<thead>'; |
1028 | $output .= '<thead>'; |
1024 | $output .= ' <tr>'; |
1029 | $output .= ' <tr>'; |
1025 | $output .= ' <th>'._L('ID').(($parentNS == 'gs1') ? ' '._L('(without check digit)') : '').'</th>'; |
1030 | $output .= ' <th>'._L('ID').(($parentNS == 'gs1') ? ' '._L('(without check digit)') : '').'</th>'; |
1026 | if ($enable_weid_presentation && ($parentNS == 'oid') && !$objParent->isRoot()) { |
1031 | if ($enable_weid_presentation && ($parentNS == 'oid') && !$objParent->isRoot()) { |
1027 | $output .= ' <th><abbr title="'._L('Binary-to-text encoding used for WEIDs').'">'._L('Base36').'</abbr></th>'; |
1032 | $output .= ' <th><abbr title="'._L('Binary-to-text encoding used for WEIDs').'">'._L('Base36').'</abbr></th>'; |