<table>
<tr><td>Name</td><td><input name="name" type="text"></td><td>Your Full Name</td></tr>
<tr><td>Email</td><td><input name="email" type="text"></td><td>Your Email Address</td></tr>
- <tr><td>Nick Name</td><td><input name="nickname" type="text"></td><td>The Name Used to Refer to you on the site</td></tr>
+ <tr><td>User Name</td><td><input name="username" type="text"></td><td>The Name Used to Refer to you on the site</td></tr>
<tr><td><input type="submit" name="register" value="Register"></td></tr>
</table>
</form>
function gwvp_ConfigPageBody()
{
-
+?>
+<h1>Global Configuration</h1>
+<form method="post">
+<table>
+<tr><td>Allow User Registration</td><td><input type="checkbox" name="allowreg"></td></tr>
+
+</table>
+</form>
+<?php
}
?>
\ No newline at end of file
"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
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
$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"];
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
$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);
}
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);
}
echo "<tr><td>Site Name</td><td><input type=\"text\" name=\"sitename\"></td><td>Some Name for your site</td></tr>";
echo "<tr><td>First User Full Name</td><td><input type=\"text\" name=\"firstuserfullname\"></td><td>The name of the admin of your site</td></tr>";
echo "<tr><td>First User email address</td><td><input type=\"text\" name=\"firstuseremail\"></td><td>The email address of the admin of your site (login)</td></tr>";
- echo "<tr><td>First User Nick Name</td><td><input type=\"text\" name=\"firstusernickname\"></td><td>The name used to idenity the user on the site</td></tr>";
+ echo "<tr><td>First User Username</td><td><input type=\"text\" name=\"firstuserusername\"></td><td>The name used to idenity the user on the site</td></tr>";
echo "<tr><td>First User Password</td><td><input type=\"text\" name=\"pass1\"></td><td>Password for the user</td></tr>";
echo "<tr><td>First User Password (confirm)</td><td><input type=\"text\" name=\"pass2\"></td><td>and confirm it...</td></tr>";
echo "<tr><td>Database Type</td><td><select name=\"dbtype\"><option value=\"sqlite\">SQLite</option></select></td><td>SQLite only at this point</td></tr>";
$sitename = $_REQUEST["sitename"];
$fufn = $_REQUEST["firstuserfullname"];
$fwem = $_REQUEST["firstuseremail"];
- $fwnick = $_REQUEST["firstusernickname"];
+ $fwusername = $_REQUEST["firstuserusername"];
$fwpass = $_REQUEST["pass1"];
$fwpassconf = $_REQUEST["pass2"];
$dbtype = $_REQUEST["dbtype"];
echo "<tr><td>Sitename</td><td>$sitename</td></tr>";
echo "<tr><td>fullname</td><td>$fufn</td></tr>";
echo "<tr><td>email</td><td>$fwem</td></tr>";
- echo "<tr><td>nick</td><td>$fwnick</td></tr>";
+ echo "<tr><td>username</td><td>$fwusername</td></tr>";
echo "<tr><td>pass</td><td>$fwpass</td></tr>";
echo "<tr><td>passconfirm</td><td>$fwpassconf</td></tr>";
echo "<tr><td>dbtype</td><td>$dbtype</td></tr>";
echo "<td>Full Name</td><td><input type=\"text\" name=\"fullname\"></td></tr>";
echo "<tr><td>Password</td><td><input type=\"text\" name=\"pass1\"></td>";
echo "<td>Password Confirm</td><td><input type=\"text\" name=\"pass2\"></td></tr>";
- echo "<tr><td>Nickname</td><td><input type=\"text\" name=\"nick\"></td>";
+ echo "<tr><td>Username</td><td><input type=\"text\" name=\"username\"></td>";
echo "<td>Description</td><td><input type=\"text\" name=\"desc\"></td></tr>";
echo "<tr><td><input type=\"submit\" name=\"Create\" value=\"Create\" class=\"buttons\"></td></tr>";
echo "</table>";
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 "<option value=\"$uid\">$nickname, $fullname ($email)</option>";
+ echo "<option value=\"$uid\">$username, $fullname ($email)</option>";
}
echo "</select></div></td></tr>";
echo "<tr><td><input type=\"submit\" name=\"Create\" value=\"Create\" class=\"buttons\"></td></tr>";
// user list
echo "<tr><td>";
echo "<table border=\"1\">";
- echo "<tr><th>EMail</th><th>Nick Name</th><th>Full Name</th><th>In Groups</th><th>Owns Groups</th><th>Description</th><th>Admin?</th><th>Status</th></tr>";
+ echo "<tr><th>EMail</th><th>Username</th><th>Full Name</th><th>In Groups</th><th>Owns Groups</th><th>Description</th><th>Admin?</th><th>Status</th></tr>";
/*
* $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"];
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) {
}
}
- echo "<tr><td>$email</td><td>$nickname</td><td>$fullname</td><td>$ugroups</td><td>$ogroups</td><td>$desc</td><td>$globaladmin</td><td>$status</td></tr>";
+ echo "<tr><td>$email</td><td>$username</td><td>$fullname</td><td>$ugroups</td><td>$ogroups</td><td>$desc</td><td>$globaladmin</td><td>$status</td></tr>";
}
echo "</table>";
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";