From: paulr Date: Wed, 2 Nov 2011 15:15:03 +0000 (+1100) Subject: originally i had planned for the username to be the email address and X-Git-Url: http://git.pjr.cc/?a=commitdiff_plain;h=d6d341a5742ed8021fa768c924846e04d46156e1;p=gwvp.git originally i had planned for the username to be the email address and to have a nick name which was generally visible... until i realised you cant go http://usernam@email.com@website/ for a login to the git repo (which you need for git clone http://.../ urls that have logins) --- diff --git a/gwvplib/gwvpauth.php b/gwvplib/gwvpauth.php index 27afec8..73107e5 100644 --- a/gwvplib/gwvpauth.php +++ b/gwvplib/gwvpauth.php @@ -51,7 +51,7 @@ function gwvp_RegistrationPageBody() - +
NameYour Full Name
EmailYour Email Address
Nick NameThe Name Used to Refer to you on the site
User NameThe Name Used to Refer to you on the site
diff --git a/gwvplib/gwvpconfig.php b/gwvplib/gwvpconfig.php index cc0bafd..2c04eab 100644 --- a/gwvplib/gwvpconfig.php +++ b/gwvplib/gwvpconfig.php @@ -26,7 +26,15 @@ function gwvp_ConfigPage() function gwvp_ConfigPageBody() { - +?> +

Global Configuration

+
+ + + +
Allow User Registration
+
+ \ No newline at end of file diff --git a/gwvplib/gwvpdatabase.php b/gwvplib/gwvpdatabase.php index c2d37cf..267a6e0 100644 --- a/gwvplib/gwvpdatabase.php +++ b/gwvplib/gwvpdatabase.php @@ -16,7 +16,7 @@ function gwvp_dbCreateSQLiteStructure($dbloc) "users_id" INTEGER PRIMARY KEY AUTOINCREMENT, "user_full_name" TEXT, "user_password" TEXT, - "user_nickname" TEXT, + "user_username" TEXT, "user_email" TEXT, "user_desc" TEXT, "user_status" INTEGER @@ -106,19 +106,19 @@ function gwvp_ConnectDB() return $DB_CONNECTION; } -function gwvp_createUser($email, $fullname, $password, $nick, $desc, $status) +function gwvp_createUser($email, $fullname, $password, $username, $desc, $status) { $conn = gwvp_ConnectDB(); // TODO: change from sha1 $shapass = sha1($password); //error_log("Create user called with $email"); - $conn->query("insert into users values (null, '$fullname', '$shapass', '$nick', '$email', '$desc', '$status')"); + $conn->query("insert into users values (null, '$fullname', '$shapass', '$username', '$email', '$desc', '$status')"); /* * "users_id" INTEGER PRIMARY KEY AUTOINCREMENT, "user_full_name" TEXT, "user_password" TEXT, - "user_nickname" TEXT, + "user_username" TEXT, "user_email" TEXT, "user_desc" TEXT, "user_status" INTEGER @@ -138,7 +138,7 @@ function gwvp_getUsers() $returns[$rn]["id"] = $u_res["users_id"]; $returns[$rn]["fullname"] = $u_res["user_full_name"]; $returns[$rn]["password"] = $u_res["user_password"]; - $returns[$rn]["nickname"] = $u_res["user_nickname"]; + $returns[$rn]["username"] = $u_res["user_username"]; $returns[$rn]["email"] = $u_res["user_email"]; $returns[$rn]["desc"] = $u_res["user_desc"]; $returns[$rn]["status"] = $u_res["user_status"]; @@ -423,13 +423,13 @@ function gwvp_IsUserAdmin($email) return false; } -function gwvp_ModifyUser($userid, $email=null, $fullname=null, $password=null, $nickname=null, $desc=null, $status=null) +function gwvp_ModifyUser($userid, $email=null, $fullname=null, $password=null, $username=null, $desc=null, $status=null) { /* * "users_id" INTEGER PRIMARY KEY AUTOINCREMENT, "user_full_name" TEXT, "user_password" TEXT, - "user_nickname" TEXT, + "user_username" TEXT, "user_email" TEXT, "user_desc" TEXT, "user_status" INTEGER @@ -454,8 +454,8 @@ function gwvp_ModifyUser($userid, $email=null, $fullname=null, $password=null, $ $conn->query($sql); } - if($nickname != null) { - $sql = "update users set user_nickname='$nickname' where users_id='$userid'"; + if($username != null) { + $sql = "update users set user_username='$username' where users_id='$userid'"; $conn->query($sql); } diff --git a/gwvplib/gwvpdebug.php b/gwvplib/gwvpdebug.php index ae98816..47e630f 100644 --- a/gwvplib/gwvpdebug.php +++ b/gwvplib/gwvpdebug.php @@ -59,7 +59,7 @@ function gwvp_DebugCall() header("Location: $BASE_URL/debug"); break; case "createusersandgroups": - // gwvp_createUser($email, $fullname, $password, $nick, $desc, $status) + // gwvp_createUser($email, $fullname, $password, $username, $desc, $status) for($i=20; $i<120; $i++) { gwvp_createUser("test$i@test.com", "test$i", "asdf", "test$i", "test$i user", 0); } diff --git a/gwvplib/gwvpsetup.php b/gwvplib/gwvpsetup.php index a6d63ac..1116156 100644 --- a/gwvplib/gwvpsetup.php +++ b/gwvplib/gwvpsetup.php @@ -87,7 +87,7 @@ function gwvp_goSetupGoMain() echo "Site NameSome Name for your site"; echo "First User Full NameThe name of the admin of your site"; echo "First User email addressThe email address of the admin of your site (login)"; - echo "First User Nick NameThe name used to idenity the user on the site"; + echo "First User UsernameThe name used to idenity the user on the site"; echo "First User PasswordPassword for the user"; echo "First User Password (confirm)and confirm it..."; echo "Database TypeSQLite only at this point"; @@ -119,7 +119,7 @@ function gwvp_goSetupDoInstall() $sitename = $_REQUEST["sitename"]; $fufn = $_REQUEST["firstuserfullname"]; $fwem = $_REQUEST["firstuseremail"]; - $fwnick = $_REQUEST["firstusernickname"]; + $fwusername = $_REQUEST["firstuserusername"]; $fwpass = $_REQUEST["pass1"]; $fwpassconf = $_REQUEST["pass2"]; $dbtype = $_REQUEST["dbtype"]; @@ -132,7 +132,7 @@ function gwvp_goSetupDoInstall() echo "Sitename$sitename"; echo "fullname$fufn"; echo "email$fwem"; - echo "nick$fwnick"; + echo "username$fwusername"; echo "pass$fwpass"; echo "passconfirm$fwpassconf"; echo "dbtype$dbtype"; diff --git a/gwvplib/gwvpuseradmin.php b/gwvplib/gwvpuseradmin.php index cb5f997..e282fd0 100644 --- a/gwvplib/gwvpuseradmin.php +++ b/gwvplib/gwvpuseradmin.php @@ -61,7 +61,7 @@ function gwvp_UserAdminPageBody() echo "Full Name"; echo "Password"; echo "Password Confirm"; - echo "Nickname"; + echo "Username"; echo "Description"; echo ""; echo ""; @@ -78,9 +78,9 @@ function gwvp_UserAdminPageBody() foreach($users as $u_users) { $uid = $u_users["id"]; $email = $u_users["email"]; - $nickname = $u_users["nickname"]; + $username = $u_users["username"]; $fullname = $u_users["fullname"]; - echo ""; + echo ""; } echo ""; echo ""; @@ -93,12 +93,12 @@ function gwvp_UserAdminPageBody() // user list echo ""; echo ""; - echo ""; + echo ""; /* * $returns[$rn]["id"] = $u_res["users_id"]; $returns[$rn]["fullname"] = $u_res["user_full_name"]; $returns[$rn]["password"] = $u_res["user_password"]; - $returns[$rn]["nickname"] = $u_res["user_nickname"]; + $returns[$rn]["username"] = $u_res["user_username"]; $returns[$rn]["email"] = $u_res["user_email"]; $returns[$rn]["desc"] = $u_res["user_desc"]; $returns[$rn]["status"] = $u_res["user_status"]; @@ -107,7 +107,7 @@ function gwvp_UserAdminPageBody() foreach($users as $u_users) { $email = $u_users["email"]; $fullname = $u_users["fullname"]; - $nickname = $u_users["nickname"]; + $username = $u_users["username"]; $desc = $u_users["desc"]; $status = $u_users["status"]; if(gwvp_IsUserAdmin($email) == 1) { @@ -132,7 +132,7 @@ function gwvp_UserAdminPageBody() } } - echo ""; + echo ""; } echo "
EMailNick NameFull NameIn GroupsOwns GroupsDescriptionAdmin?Status
EMailUsernameFull NameIn GroupsOwns GroupsDescriptionAdmin?Status
$email$nickname$fullname$ugroups$ogroups$desc$globaladmin$status
$email$username$fullname$ugroups$ogroups$desc$globaladmin$status
"; diff --git a/unittests/sqlitedb.php b/unittests/sqlitedb.php index c5c0d37..3b99eb2 100644 --- a/unittests/sqlitedb.php +++ b/unittests/sqlitedb.php @@ -23,11 +23,11 @@ gwvp_dbCreateSQLiteStructure("$db_name"); gwvp_ConnectDB(); -// function gwvp_createUser($email, $fullname, $password, $nick, $desc, $status) +// function gwvp_createUser($email, $fullname, $password, $username, $desc, $status) // test users creation -gwvp_createUser("test@test.com", "test user", "password", "nick", "desc", "0"); -gwvp_createUser("test2@test.com", "test2 user", "password", "nick2", "desc2", "0"); -gwvp_createUser("test3@test.com", "test2 user", "password", "nick2", "desc2", "0"); +gwvp_createUser("test@test.com", "test user", "password", "username", "desc", "0"); +gwvp_createUser("test2@test.com", "test2 user", "password", "username2", "desc2", "0"); +gwvp_createUser("test3@test.com", "test2 user", "password", "usernme3", "desc2", "0"); $users = gwvp_getUsers(); echo "Users\n"; echo "\tCreate test@test.com\n";