Viewing file: addUser.inc.php3 (3.6 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
require("$mysqlCall");
if(checkSuperSession($superSession, $REMOTE_ADDR))
{
include("include/rootGui.inc.php3");
$userId = getUserSUId($superSession);
$userInfo = getUserInfo($userId);
if(($userInfo[SuperUser] == 1) && ($userInfo[manageUsers]==1) && ($userInfo[active]==1))
{
if($addValues)
{
$email2 = strstr($email, "@");
if(strlen($email2)==0)
{
print("The is not a real email address! Try again :)<br><br>");
$ddb=0;
}
else
{
require("$mysqlCall");
$query = "SELECT * FROM $users where user=\"$user\" OR email=\"$email\"";
$mysql_result = mysql_query($query, $mysql_link);
if($row = mysql_fetch_row($mysql_result))
{
print("That user name or email address is already used on the system<br>");
$ddb=1;
}
require("$mysqlCall");
$query = "SELECT * FROM $spooledUsers where user=\"$user\" OR email=\"$email\" ";
$mysql_result = mysql_query($query, $mysql_link);
if($row = mysql_fetch_row($mysql_result))
{
print("That user name or email address is already used on the system (spooling list)<br>");
$ddb=1;
}
if(!isset($ddb))
{
$zero=0;
$one=1;
require("$mysqlCall");
$pass1=mina;
/* print("$pass1<br>"); */
$pass = crypt($pass1,$user);
$insert = "insert into $users values('', '$user', '$pass', '$zipo', '$email', '$zipo', '$one','$zipo', '$zipo', '$zipo','$zipo', '$zipo','$zipo')";
print "<br>";
mail($email, "password", "Vas pasword je: $pass1");
$result = MYSQL_QUERY($insert);
if($result)
{
print("That worked");
}
else
{
print("Something wrong with add new user");
}
print("User has been added as a normal user<br> You can now change their rights if you want");
$query = "SELECT * FROM $users where user=\"$user\"";
$mysql_result = mysql_query($query, $mysql_link);
if($row = mysql_fetch_row($mysql_result))
{
$userId2 = $row[0];
}
$userInfo = getUserInfo($userId2);
include("userValues.inc.php3");
print("user = $user");
include("users.php3");
}
}
}
else
{
print("An eight char password is created for the user and emailed to them<br>");
print("<form method=\"post\" action=\"index.php3?mode=addUser&superSession=$superSession&addValues=1\">");
print("<table border=0 cellpadding=3 cellspacing=0 >");
print("<tr><td bgcolor=$border_colour align=center>");
print("<table width=100% border=0 cellpadding=5 cellspacing=0 >");
print("<tr>\n");
print("<td bgcolor=$table_colour>User</td>");
print("<td bgcolor=$bgcolour><input type=text name='user'></td>");
print("</tr>\n");
print("<tr>\n");
print("<td bgcolor=$table_colour>E-Mail</td>");
print("<td bgcolor=$bgcolour><input type=text name='email'></td>");
print("</tr>\n");
print("<tr>\n");
print("<td colspan=2 align=right bgcolor=$table_colour2><input type=submit></td>");
print("</tr>\n");
print("</table>");
print("<tr><td>");
print("</table>");
print("<br><br>");
}
}
else
{
print("You do not have access to this function<br>");
}
include("include/guiBase.inc.php3");
}
?>
|