* @copyright Deakin University 2007,2008 * @package queXS * @subpackage admin * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2 * * * @todo Make timezone a drop down list * */ /** * Configuration file */ include ("../config.inc.php"); /** * Database file */ include ("../db.inc.php"); /** * Authentication file */ include ("auth-admin.php"); /** * XHTML functions */ include ("../functions/functions.xhtml.php"); global $db; $a = false; if (isset($_POST['client'])) { $client = $db->qstr($_POST['client'],get_magic_quotes_gpc()); $firstname = $db->qstr($_POST['firstname'],get_magic_quotes_gpc()); $email = $db->qstr($_POST['email'],get_magic_quotes_gpc()); $lastname = $db->qstr($_POST['lastname'],get_magic_quotes_gpc()); $time_zone_name = $db->qstr($_POST['Time_zone_name'],get_magic_quotes_gpc()); if (!empty($_POST['client'])) { $sql = "INSERT INTO client (`client_id` ,`username` ,`firstName` ,`lastName`, `Time_zone_name`) VALUES (NULL , $client, $firstname , $lastname, $time_zone_name);"; if ($db->Execute($sql)) { include_once("../include/limesurvey/admin/classes/core/sha256.php"); //Insert into lime_users $sql = "INSERT INTO " . LIME_PREFIX . "users (`users_name`,`password`,`full_name`,`parent_id`,`superadmin`,`email`,`lang`) VALUES ($client, '" . SHA256::hashing($_POST['password']) . "',$firstname,1,0,$email,'auto')"; $db->Execute($sql); $a = T_("Added: $client"); } else $a = T_("Could not add") . " " . $client . ". " . T_("There may already be a client of this name"); } } xhtml_head(T_("Add a client"),true,array("../include/bootstrap/css/bootstrap.min.css","../css/custom.css")); $sql = "SELECT Time_zone_name as value, Time_zone_name as description FROM timezone_template"; $rs = $db->GetAll($sql); if ($a) { ?>