Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Added timeout for ldap bind/search operations | 502fbf1287f1ad37f7c6c82c473c9b472d3fa65a | Catalin(ux) M. BOIE | 2017-11-26 15:46:51 |
Default uid_attr for ldap is now 'uid' | 6e3993359d506d76ec739dd87fa682eea6b5a3b6 | Catalin(ux) M. BOIE | 2017-11-26 14:57:58 |
lock cache must not store 'ok' field | 5a600b275fcf50c2df2cb0253a80aa99ae145b0d | Catalin(ux) M. BOIE | 2017-11-26 14:41:33 |
CURLOPT_SSLCERT must not be provided in newer versions of curl | d14ad10139a9a5f4f59961fbaa3fe371754e806a | Catalin(ux) M. BOIE | 2017-11-26 14:25:32 |
Newer git, by providing an empty user, will not sent the user. This is bad, switch to using 'guest' user | 0c84bf03fa4ceb3fe4b832c39134116d8cea6105 | Catalin(ux) M. BOIE | 2017-11-26 14:23:11 |
Fixed edit_no_check's pass field usage | ebd3ff1f73009bcf5943589e19ee8a573d80f6ac | Catalin(ux) M. BOIE | 2017-11-26 14:20:45 |
Small fix for typos in test runner | a85032bd5854816c8df6e8d23a1817e462a6f31e | Catalin(ux) M. BOIE | 2017-11-26 13:47:18 |
We must set oversize_diff, even if also_patch is false | c347c23a5ecc022a4354cfa27088fe3db5cddeea | Catalin(ux) M. BOIE | 2017-11-26 13:43:31 |
Added debug for rg_cache_merge function | 740eb3b5dbd19ff8ab852ff745c4cad4b1b1a4fb | Catalin(ux) M. BOIE | 2017-11-26 13:42:38 |
Improved a little bit the way the tests are run | c169ce030975bd0580d867a806df9c401a2b38e8 | Catalin(ux) M. BOIE | 2017-11-26 13:42:06 |
Latest git breaks anonymous push - fix it by using 'guest' user instead of the empty one | b3d1265cc9b44786c0fd7aa2988c5614f62db978 | Catalin(ux) M. BOIE | 2017-11-26 12:39:43 |
Lots of changes, but mostly LDAP support | 029d34fdc14587b9ef6eb9e87ac36f66caefdacf | Catalin(ux) M. BOIE | 2017-11-24 19:35:59 |
Fix state bug which triggered a not needed update of the structure | f6118c456bfc960782a53b9dc090046d542f9db9 | Catalin(ux) M. BOIE | 2017-11-24 19:12:38 |
Some free_result and unlock only if successfully locked | 64666ca1371c004f74376fce2e2a67ee9f608a34 | Catalin(ux) M. BOIE | 2017-10-01 06:10:47 |
If git_log_simple returns error, just return error | acbbacda0947a3f8496c9b15870db574c08db715 | Catalin(ux) M. BOIE | 2017-08-31 03:43:25 |
Be less verbose in rg_rights_test | 3cb2d12960b059b61f7c2c47c6198fbbdee8bccd | Catalin(ux) M. BOIE | 2017-08-10 04:19:34 |
Remove rg_log_buf stuff because of performance issues | e85f70b38c197d44a9b4878dcff78da4f4f56562 | Catalin(ux) M. BOIE | 2017-08-08 20:08:56 |
Use a more efficient way to log multi line strings | 67923e6760bf26923bd7ce9c9bced7a3f526cecf | Catalin(ux) M. BOIE | 2017-08-08 19:54:00 |
css: make border more visible | 378b328cde875d1584f3df6d8635b340ee23207a | Catalin(ux) M. BOIE | 2017-07-22 23:27:29 |
struct: add itime for commit_labels | 67d189b9d3330ab4dc3b6a0580a736522b6c1d36 | Catalin(ux) M. BOIE | 2017-07-22 23:05:02 |
File | Lines added | Lines deleted |
---|---|---|
inc/ldap.inc.php | 5 | 2 |
inc/ldap_core.inc.php | 3 | 3 |
inc/struct.inc.php | 1 | 0 |
root/themes/default/admin/ldap/add_edit.html | 5 | 0 |
root/themes/default/admin/ldap/list/header.html | 1 | 0 |
root/themes/default/admin/ldap/list/line.html | 1 | 0 |
tests/ldap.php | 1 | 1 |
File inc/ldap.inc.php changed (mode: 100644) (index b6511d5..ebb2c98) | |||
... | ... | function rg_ldap_add($db, $who, $data) | |
124 | 124 | . ', url, bind_dn, bind_pass, user_base' | . ', url, bind_dn, bind_pass, user_base' |
125 | 125 | . ', uid_attr, filter, group_base, group_attr' | . ', uid_attr, filter, group_base, group_attr' |
126 | 126 | . ', group_filter, admin_group, ca_cert' | . ', group_filter, admin_group, ca_cert' |
127 | . ', prio, session_time)' | ||
127 | . ', prio, session_time, timeout)' | ||
128 | 128 | . ' VALUES (@@itime@@, @@who@@, @@name@@' | . ' VALUES (@@itime@@, @@who@@, @@name@@' |
129 | 129 | . ', @@url@@, @@bind_dn@@, @@bind_pass@@' | . ', @@url@@, @@bind_dn@@, @@bind_pass@@' |
130 | 130 | . ', @@user_base@@, @@uid_attr@@, @@filter@@' | . ', @@user_base@@, @@uid_attr@@, @@filter@@' |
... | ... | function rg_ldap_add($db, $who, $data) | |
150 | 150 | . ', ca_cert = @@ca_cert@@' | . ', ca_cert = @@ca_cert@@' |
151 | 151 | . ', prio = @@prio@@' | . ', prio = @@prio@@' |
152 | 152 | . ', session_time = @@session_time@@' | . ', session_time = @@session_time@@' |
153 | . ', timeout = @@timeout@@' | ||
153 | 154 | . ' WHERE id = @@id@@'; | . ' WHERE id = @@id@@'; |
154 | 155 | } | } |
155 | 156 | ||
... | ... | function rg_ldap_login($db, $user, $pass, &$ui) | |
320 | 321 | foreach ($sl['list'] as $si) { | foreach ($sl['list'] as $si) { |
321 | 322 | //rg_log_ml('ldap server info: ' . print_r($si, TRUE)); | //rg_log_ml('ldap server info: ' . print_r($si, TRUE)); |
322 | 323 | ||
323 | $r = rg_ldap_core_connect($si['url']); | ||
324 | $r = rg_ldap_core_connect($si['url'], $si['timeout']); | ||
324 | 325 | if ($r['ok'] !== 1) { | if ($r['ok'] !== 1) { |
325 | 326 | rg_log('DEBUG: cannot connect: ' . $r['errmsg']); | rg_log('DEBUG: cannot connect: ' . $r['errmsg']); |
326 | 327 | $ret['errmsg'] = $r['errmsg']; | $ret['errmsg'] = $r['errmsg']; |
... | ... | function rg_ldap_add_high_level($db, $rg, $op, $paras) | |
593 | 594 | 'group_attr' => rg_var_str('ldap::group_attr'), | 'group_attr' => rg_var_str('ldap::group_attr'), |
594 | 595 | 'group_filter' => rg_var_str('ldap::group_filter'), | 'group_filter' => rg_var_str('ldap::group_filter'), |
595 | 596 | 'admin_group' => rg_var_str('ldap::admin_group'), | 'admin_group' => rg_var_str('ldap::admin_group'), |
597 | 'timeout' => rg_var_uint('ldap::timeout'), | ||
596 | 598 | 'ca_cert' => rg_var_str('ldap::ca_cert') | 'ca_cert' => rg_var_str('ldap::ca_cert') |
597 | 599 | ); | ); |
598 | 600 | ||
... | ... | function rg_ldap_add_high_level($db, $rg, $op, $paras) | |
630 | 632 | 'group_attr' => '', | 'group_attr' => '', |
631 | 633 | 'group_filter' => '', | 'group_filter' => '', |
632 | 634 | 'admin_group' => '', | 'admin_group' => '', |
635 | 'timeout' => '10', | ||
633 | 636 | 'ca_cert' => '' | 'ca_cert' => '' |
634 | 637 | ); | ); |
635 | 638 | } else { // edit | } else { // edit |
File inc/ldap_core.inc.php changed (mode: 100644) (index 92ed4fd..df680b1) | |||
... | ... | function rg_ldap_core_error() | |
21 | 21 | /* | /* |
22 | 22 | * Connects to a ldap server | * Connects to a ldap server |
23 | 23 | */ | */ |
24 | function rg_ldap_core_connect($server) | ||
24 | function rg_ldap_core_connect($server, $timeout) | ||
25 | 25 | { | { |
26 | 26 | $ret = array('ok' => 0); | $ret = array('ok' => 0); |
27 | 27 | while (1) { | while (1) { |
... | ... | function rg_ldap_core_connect($server) | |
36 | 36 | // http://php.net/manual/en/function.ldap-set-option.php | // http://php.net/manual/en/function.ldap-set-option.php |
37 | 37 | ldap_set_option($r, LDAP_OPT_PROTOCOL_VERSION, 3); | ldap_set_option($r, LDAP_OPT_PROTOCOL_VERSION, 3); |
38 | 38 | ldap_set_option($r, LDAP_OPT_DEREF, LDAP_DEREF_ALWAYS); | ldap_set_option($r, LDAP_OPT_DEREF, LDAP_DEREF_ALWAYS); |
39 | ldap_set_option($r, LDAP_OPT_TIMELIMIT, 10); | ||
40 | ldap_set_option($r, LDAP_OPT_NETWORK_TIMEOUT, 10); | ||
39 | ldap_set_option($r, LDAP_OPT_TIMELIMIT, $timeout); | ||
40 | ldap_set_option($r, LDAP_OPT_NETWORK_TIMEOUT, $timeout); | ||
41 | 41 | //ldap_set_option($r, LDAP_OPT_DEBUG_LEVEL, 7); | //ldap_set_option($r, LDAP_OPT_DEBUG_LEVEL, 7); |
42 | 42 | ||
43 | 43 | $ret['con'] = $r; | $ret['con'] = $r; |
File inc/struct.inc.php changed (mode: 100644) (index 12ece8d..5d4a443) | |||
... | ... | $rg_sql_struct[44]['table'] = array( | |
620 | 620 | . ", ca_cert TEXT NOT NULL" | . ", ca_cert TEXT NOT NULL" |
621 | 621 | . ", csn TEXT NOT NULL DEFAULT ''" | . ", csn TEXT NOT NULL DEFAULT ''" |
622 | 622 | . ", plan_id INTEGER NOT NULL" | . ", plan_id INTEGER NOT NULL" |
623 | . ", timeout INTEGER NOT NULL" | ||
623 | 624 | . ")", | . ")", |
624 | 625 | 'ldap_cache' => | 'ldap_cache' => |
625 | 626 | "CREATE TABLE ldap_cache" | "CREATE TABLE ldap_cache" |
File root/themes/default/admin/ldap/add_edit.html changed (mode: 100644) (index 39ebca2..7cfe412) | |||
79 | 79 | <input type="text" name="ldap::admin_group" id="admin_group" value="@@ldap::admin_group@@" /> | <input type="text" name="ldap::admin_group" id="admin_group" value="@@ldap::admin_group@@" /> |
80 | 80 | </p> | </p> |
81 | 81 | ||
82 | <p> | ||
83 | <label for="timeout">Timeout (in seconds)</label><br /> | ||
84 | <input type="text" name="ldap::timeout" id="timeout" value="@@ldap::timeout@@" /> | ||
85 | </p> | ||
86 | |||
82 | 87 | <p> | <p> |
83 | 88 | <label for="ca_cert">CA certificates chain to authenticate the LDAP server (optional)</label><br /> | <label for="ca_cert">CA certificates chain to authenticate the LDAP server (optional)</label><br /> |
84 | 89 | <textarea name="ldap::ca_cert" id="ca_cert" rows="4" cols="50">@@ldap::ca_cert@@</textarea> | <textarea name="ldap::ca_cert" id="ca_cert" rows="4" cols="50">@@ldap::ca_cert@@</textarea> |
File root/themes/default/admin/ldap/list/header.html changed (mode: 100644) (index 81f9416..9eada9f) | |||
20 | 20 | <th>Group filter</th> | <th>Group filter</th> |
21 | 21 | <th>Admin group</th> | <th>Admin group</th> |
22 | 22 | <th>CA certificate</th> | <th>CA certificate</th> |
23 | <th>Timeout</th> | ||
23 | 24 | <th>Operations</th> | <th>Operations</th> |
24 | 25 | </tr> | </tr> |
25 | 26 |
File root/themes/default/admin/ldap/list/line.html changed (mode: 100644) (index 1c9fbd9..eaccb38) | |||
14 | 14 | <td>@@group_attr@@</td> | <td>@@group_attr@@</td> |
15 | 15 | <td>@@group_filter@@</td> | <td>@@group_filter@@</td> |
16 | 16 | <td>@@admin_group@@</td> | <td>@@admin_group@@</td> |
17 | <td>@@timeout@@</td> | ||
17 | 18 | <td>@@ca_cert@@</td> | <td>@@ca_cert@@</td> |
18 | 19 | <td><a href="/op/admin/ldap/edit/@@id@@">[Edit]</a></td> | <td><a href="/op/admin/ldap/edit/@@id@@">[Edit]</a></td> |
19 | 20 | </tr> | </tr> |
File tests/ldap.php changed (mode: 100644) (index c306001..d784fad) | |||
... | ... | rg_log_exit(); | |
281 | 281 | rg_log(''); | rg_log(''); |
282 | 282 | rg_log_enter('Deleting user user4...'); | rg_log_enter('Deleting user user4...'); |
283 | 283 | $r = rg_ldap_core_connect('ldap://' . $l1['rg_ldap_addr'] | $r = rg_ldap_core_connect('ldap://' . $l1['rg_ldap_addr'] |
284 | . ':' . $l1['rg_ldap_port']); | ||
284 | . ':' . $l1['rg_ldap_port'], 3 /*timeout*/); | ||
285 | 285 | if ($r['ok'] !== 1) { | if ($r['ok'] !== 1) { |
286 | 286 | rg_log('Cannot connect to second server: ' . $r['errmsg'] . '!'); | rg_log('Cannot connect to second server: ' . $r['errmsg'] . '!'); |
287 | 287 | exit(1); | exit(1); |