<?phprequire_once("inc/toolkit.inc.php");if($_POST["submit"]&&$_POST["username"]!=""&&$_POST["password"]!=""&&$_POST["fullname"]!=""&&$_POST["email"]!=""&&$_POST["level"]>0){if(substr_count($_POST["username"]," ")==0){if(strlen($_POST["password"])<8){$error=_('Password length should be at least 8 characters.');}else{add_user($_POST["username"],$_POST["password"],$_POST["fullname"],$_POST["email"],$_POST["level"],$_POST["description"],$_POST["active"]);clean_page($BASE_URL.$BASE_PATH."users.php");}}else{$error=_('Usernames can\'t contain spaces');}}elseif($_POST["submit"]){$error=_('Please fill in all fields');}include_once("inc/header.inc.php");if($error!=""){?><divclass="error"><?echo$error;?></div><?}?><h2><?echo_('User admin');?></h2><?if(!level(10)){error(ERR_LEVEL_10);}?><h3><?echo_('Current users');?></h3><?$users=show_users('');?><table><tr><th> </th><th><?echo_('Name');?></th><th><?echo_('Zones');?></th><th><?echo_('Zone list');?></th><th><?echo_('Level');?></th><th><?echo_('Status');?></th></tr><?$users=show_users('',ROWSTART,ROWAMOUNT);foreach($usersas$c){?><tr><tdclass="n"><ahref="delete_user.php?id=<?echo$c["id"]?>"><imgsrc="images/delete.gif"alt="[ <?echo_('Delete user');?> ]"></a></td><tdclass="n"><ahref="edit_user.php?id=<?echo$c["id"]?>"><?echo$c["fullname"]?></A>(<?echo$c["username"]?>)</td><tdclass="n"><?echo$c["numdomains"]?></td><tdclass="n"><?$domains=get_domains_from_userid($c["id"]);foreach($domainsas$d){?><ahref="delete_domain.php?id=<?echo$d["id"]?>"><imgsrc="images/delete.gif"alt="[ <?echo_('Delete domain');?> ]"></a> <ahref="edit.php?id=<?echo$d["id"]?>"><?echo$d["name"]?></a><br><?}?></td><tdclass="n"><?echo$c["level"]?></td><tdclass="n"><?echoget_status($c["active"])?></td></tr><?print"\n";}?></table><p><?echo_('Number of users');?>:<?echocount($users);?>.</p><divclass="showmax"><?show_pages(count($users),ROWAMOUNT);?></div><?// eo div showmax ?><h3><?echo_('Create new user');?></h3><formmethod="post"action="users.php"><table><tr><tdclass="n"><?echo_('User name');?>:</td><tdclass="n"><inputtype="text"class="input"name="username"value="<?if($error)print$_POST["username"];?>"></td></tr><tr><tdclass="n"><?echo_('Full name');?>:</td><tdclass="n"><inputtype="text"class="input"NAME="fullname"VALUE="<?if($error)print$_POST["fullname"];?>"></td></tr><tr><tdclass="n"><?echo_('Password');?>:</td><tdclass="n"><inputtype="text"class="input"NAME="password"VALUE="<?if($error)print$_POST["password"];?>"></td></tr><tr><tdclass="n"><?echo_('E-mail');?>:</td><tdclass="n"><inputtype="text"class="input"NAME="email"VALUE="<?if($error)print$_POST["email"];?>"></td></tr><tr><tdclass="n"><?echo_('User level');?>:</td><tdclass="n"><selectname="level"><optionvalue="1">1(<?echoleveldescription(1)?>)</option><optionvalue="5">5(<?echoleveldescription(5)?>)</option><optionvalue="10">10(<?echoleveldescription(10)?>)</option></select></td></tr><tr><tdclass="n"><?echo_('Description');?>:</td><tdclass="n"><textarearows="6"cols="30"class="inputarea"name="description"><?if($error)print$_POST["description"];?></textarea></td></tr><tr><tdclass="n"><?echo_('Active');?>:</td><tdclass="n"><inputtype="checkbox"name="active"value="1"checked></td></tr><tr><tdclass="n"> </td><tdclass="n"><inputtype="submit"class="button"name="submit"value="<?echo_('Add user');?>"></td></tr></table></form><?include_once("inc/footer.inc.php");?>