Index: trunk/extensions/OpenStackManager/OpenStackNovaUser.php |
— | — | @@ -271,6 +271,7 @@ |
272 | 272 | */ |
273 | 273 | static function LDAPSetCreationValues( $auth, $username, &$values, &$result ) { |
274 | 274 | global $wgOpenStackManagerLDAPDefaultGid; |
| 275 | + global $wgRequest; |
275 | 276 | |
276 | 277 | $values['objectclass'][] = 'person'; |
277 | 278 | $values['objectclass'][] = 'novauser'; |
— | — | @@ -285,6 +286,16 @@ |
286 | 287 | $result = false; |
287 | 288 | return false; |
288 | 289 | } |
| 290 | + $values['cn'] = $username; |
| 291 | + if ( '' != $auth->realname ) { |
| 292 | + $values['displayname'] = $auth->realname; |
| 293 | + } |
| 294 | + $username = $wgRequest->getText('shellaccountname'); |
| 295 | + if ( ! preg_match( "/^[a-z][a-z0-9\-_]*$/", $username ) ) { |
| 296 | + $result = false; |
| 297 | + return false; |
| 298 | + } |
| 299 | + $values['uid'] = $username; |
289 | 300 | $values['uidnumber'] = $uidnumber; |
290 | 301 | $values['gidnumber'] = $wgOpenStackManagerLDAPDefaultGid; |
291 | 302 | $values['homedirectory'] = '/home/' . $username; |
Index: trunk/extensions/OpenStackManager/OpenStackManager.php |
— | — | @@ -46,11 +46,11 @@ |
47 | 47 | $wgOpenStackManagerDNSSOA = array( 'hostmaster' => 'hostmaster@localhost.localdomain', 'refresh' => '1800', 'retry' => '3600', 'expiry' => '86400', 'minimum' => '7200' ); |
48 | 48 | $wgOpenStackManagerPuppetOptions = array( |
49 | 49 | 'enabled' => false, |
50 | | - 'defaultclasses' => array(), |
51 | | - 'defaultvariables' => array(), |
52 | | - 'availableclasses' => array(), |
53 | | - 'availablevariables' => array(), |
54 | | - ); |
| 50 | + 'defaultclasses' => array(), |
| 51 | + 'defaultvariables' => array(), |
| 52 | + 'availableclasses' => array(), |
| 53 | + 'availablevariables' => array(), |
| 54 | + ); |
55 | 55 | |
56 | 56 | $dir = dirname(__FILE__) . '/'; |
57 | 57 | |