You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: addTeamspaceCCIDUser.php
+16-13
Original file line number
Diff line number
Diff line change
@@ -23,38 +23,41 @@
23
23
class AddCCIDUser extends Maintenance {
24
24
25
25
publicfunction__construct() {
26
-
parent::__construct();
27
-
$this->mDescription = "Create a new CCID user account for Teamspace.";
26
+
parent::__construct();
27
+
$this->mDescription = 'Create a new CCID user account for Teamspace.';
28
28
29
-
#$this->addArg( "global", "CCID global identifier of new user" );
30
-
$this->addArg( "email", "CCID email of new user (will be used as user name as well)" );
31
-
$this->addArg( "name", "Real name of user" );
29
+
$this->addArg(
30
+
'email',
31
+
'CCID email of new user (will be used as the username as well)'
32
+
);
33
+
$this->addArg( 'name', 'Real name of user' );
32
34
}
33
35
34
36
publicfunctionexecute() {
35
37
global$CASAuth;
36
38
37
39
if (! isset( $CASAuth )) {
38
-
$this->error('$CASAuth not set in LocalSettings.php', true);
40
+
$this->error('$CASAuth not set in LocalSettings.php', true);
39
41
}
40
42
41
-
$name = $global = $this->getArg( 1 );
42
43
$casuid = $email = $this->getArg( 0 );
44
+
$name = $global = $this->getArg( 1 );
43
45
$ccid_name = ucfirst ( $email );
44
46
45
47
$u = User::newFromName( $ccid_name );
46
48
// Create a new account if the user does not exists
47
49
if ($u->getID() != 0) {
48
-
$this->error("User already exists", true);
50
+
$this->error('User already exists', true);
49
51
exit(1);
50
52
} else {
51
-
//$nickname = $attr['nickname'];
52
53
// Create the user
53
54
$u->addToDatabase();
54
-
$u->setRealName($name);
55
-
$u->setEmail($casuid);
55
+
$u->setRealName($name);
56
+
$u->setEmail($casuid);
56
57
$u->confirmEmail();
57
-
$u->setPassword( md5($casuid.$CASAuth["PwdSecret"]) ); //PwdSecret is used to salt the casuid, which is then used to create an md5 hash which becomes the password
58
+
//PwdSecret is used to salt the casuid, which is then used to
0 commit comments