<?php echo "Before user addition <br>"; //====================== Supportdesk User Addition ================== include "useradd.php"; userAdd('name', 'password', 'company-name', 'email-address'); //====================== End Supportdesk User Addition ============== echo "After user addition <br>";
<?php require_once "pages.php"; $act = "users"; $ref = pageLinkAct(); pageHeader(); if (isset($_POST['create']) && !empty($_POST['newUser']) && isset($_POST['newRole'])) { // create user $user = $_POST['newUser']; $pass = !empty($_POST['newPass']) ? $_POST['newPass'] : false; $admin = $_POST['newRole'] == 1; if (userAdd($user, $pass, $admin)) { infoMessage(T_("Created"), htmlEntUTF8($user)); } else { errorMessage(T_("Creation failed"), sprintf(T_("user \"%s\" already exists"), htmlEntUTF8($user))); } } if (isset($_POST["delete"]) && !empty($_POST["sel"])) { $list = array(); // delete users foreach ($_POST["sel"] as $name) { if (userDel($name)) { $list[] = htmlEntUTF8($name); } } if (count($list)) { infoMessage(T_("Deleted"), $list); } } if (isset($_POST['apply']) && !empty($_POST['user']) && is_array($_POST['user']) && !empty($_POST['role']) && is_array($_POST['role']) && !empty($_POST['pass']) && is_array($_POST['pass']) && count($_POST['user']) == count($_POST['role']) && count($_POST['role']) == count($_POST['pass'])) { $user = $_POST['user'];
function user_content() { ?> <ul class="tabs"> <li><a href="#tab1">Lägg till ny användare</a></li> <li><a href="#tab2">Hantera användare</a></li> </ul> <div id="tab1"> <?php userAdd($error, $msg); ?> <table width="400"> <form action="system.php?do=user" method="post"> <tr> <td><label for="username">Användarnamn</label></td> <td><input type="text" id="username" name="username" /></td> </tr> <tr> <td><label for="email">E-post</label></td> <td><input type="text" id="email" name="email" /></td> </tr> <tr> <td><label for="password">Lösenord</label></td> <td><input type="password" id="password" name="password" /></td> </tr> <tr> <td><label for="password_confirm">Upprepa lösenord</label></td> <td><input type="password" id="password_confirm" name="password_confirm" /></td> </tr> <tr> <td><input type="submit" value="Lägg till" /></td> <td></td> </tr> </form></table><br /> <?php if (isset($msg)) { echo $msg; } if (isset($error['username'])) { echo $error['username']; echo "<br />"; } if (isset($error['email'])) { echo $error['email']; echo "<br />"; } if (isset($error['password'])) { echo $error['password']; echo "<br />"; } if (isset($error['password_confirm'])) { echo $error['password_confirm']; echo "<br />"; } ?> </div> <div id="tab2"> <!--ADD CONTENT--> </div> <?php }
saveTask(); getTasks(); } elseif ($_POST["action"] == "save_group") { $response['action'] = 'groups'; saveGroup(); getGroups(); } elseif ($_POST["action"] == "get_info") { $response['action'] = 'get_info'; getInfo(); } elseif ($_POST["action"] == "add_task") { $response['action'] = 'get_tasks'; addTask(); getTasks(); } elseif ($_POST["action"] == "add_user") { $response['action'] = 'get_users'; userAdd(); getUsers(); } elseif ($_POST["action"] == "remove_users") { $response['action'] = 'get_users'; usersRemove(); getUsers(); } elseif ($_POST["action"] == "get_complete_tasks") { $response['action'] = 'get_complete_tasks'; getCompleteTasks(); } elseif ($_POST["action"] == "get_groups") { $response['action'] = 'get_groups'; getGroups(); } elseif ($_POST["action"] == "add_group") { $response['action'] = 'get_tasks'; groupAdd(); getGroups();