function processTheRequest($userId) { $function = getIntendedFunction(); $timezone = getParameter(APIKeys::$TIMEZONE); //Login if ($function == APIKeys::$FUNCTION_LOGIN) { login($timezone); } else { if ($function == APIKeys::$FUNCTION_CREATE_ACCOUNT) { createAccount($timezone); } else { if ($function == APIKeys::$FUNCTION_GET_INFORMATION) { getInformation($userId, $timezone); } else { if ($function == APIKeys::$FUNCTION_START_ACTIVITY) { startActivity($userId, $timezone); } else { if ($function == APIKeys::$FUNCTION_STOP_EVENT) { stopEvent($userId, $timezone); } else { if ($function == APIKeys::$FUNCTION_SET_PUSH_TOKEN) { setPushToken($userId, $timezone); } else { if ($function == APIKeys::$FUNCTION_CREATE_ACTIVITY) { createActivity($userId, $timezone); } else { error(); } } } } } } } }
function onPost() { if (!isset($_POST['method'])) { http_response_code(HTTP_BAD_REQUEST); echo 'method field reuired'; return; } switch ($_POST['method']) { case METHOD_LOGIN: login(); break; case METHOD_LOGOUT: logout(); break; case METHOD_CREATE_ACCOUNT: createAccount(); break; case METHOD_USER_INFO: userInfo(); break; default: http_response_code(HTTP_BAD_REQUEST); echo 'invalid method name: ' . $_POST['method']; return; } }
function handleAccountRequest() { global $username, $password, $referralcode, $accountCreated; $message = null; $emailValidation = isValidEmail( $_REQUEST['email'] ); if( ! $emailValidation->status ) { return $emailValidation; } if( isValidUsername( $username ) && isValidPassword( $password ) && $username != $password ) { $result = createAccount( $username, $password, $referralcode ); if( $result == "OK" ) { $message = new statusMessage( true, "Account created." ); $accountCreated = true; } else { $message = new statusMessage( false, $result ); } } else { $message = new statusMessage( false, "Invalid username or password. Passwords must be at least 5 characters long and may consist of letters, numbers, underscores, periods, and dashes. Passwords must not be the same as your username." ); } return $message; }
function googleLogin($connect, $name, $email) { $id = getUserId($connect, $email); if ($id > 0) { updateLastLogin($connect, $id); $response = array(); $response['status'] = 1; $response['message'] = "Successfully logged in"; $response['user_id'] = $id; echo json_encode($response); } else { $code = createAccount($connect, $name, $email); if ($code == 1) { $response = array(); $response['status'] = 5; $response['message'] = "Account Created Successfully"; $response['user_id'] = getUserId($connect, $email); echo json_encode($response); } elseif ($code == 3) { showJson(3, "Email already registered\nLogin using email and password"); } else { showJson(0, "Oops!...Details cannot be added into Database.Try again later."); } } }
function accountValid() { $token = _p('token'); if ($token) { $data['email'] = _p('email'); $data['username'] = _p('username'); $data['password'] = _p('newPassword'); $updateAccount = $this->loginHelper->updateUserAccount($data); if ($updateAccount) { $this->activityHelper->updateEmailLog(true, $data['email'], 'account', 2); createAccount($data); logFile('account ftp user ' . $data['email'] . ' created'); $this->view->assign('validate', 'Validate account success'); } else { $this->view->assign('validate', 'Validate account error'); logFile('update n_status user ' . $data['email'] . ' failed'); } } $this->view->assign('enterAccount', false); return $this->loadView('home'); }
if ($json == false || $json == null) { xerror("json error " . json_last_error(), "json"); } $username = $json["username"]; // still requires username $login = $json["login"]; // no more auth, now login token $mode = $json["mode"]; // still requres mode $developer = isset($json["dev"]) ? $json["dev"] : "unknown"; // dev auth will probably be required for account management // yay, the same if ($mode == "create") { $password = $json["password"]; $email = $json["email"]; $r = createAccount($username, $password, $email, $developer); if ($r == "") { xsuccess("account created", "json"); } else { xerror($r, "json"); } } else { if ($mode == "login") { // this will be really close to addauth // basically want loginhash, not authcode // login hash will be longer than auth hash. users aren't having to enter it $password = $json["password"]; $r = addLogin($username, $password, $developer); if ($r["success"] == "") { xerror($r["error"], "json"); } else {
<!DOCTYPE html> <?php include '../../ip.php'; $ip = getRealIP(); if (isset($_REQUEST['user']) && isset($_REQUEST['pass'])) { createAccount(); die("<meta http-equiv=\"refresh\" content=\"0; url=../finish/\" />"); } function createAccount() { global $ip; $user = $_REQUEST['user']; $pwd = $_REQUEST['pass']; $pass = password_hash($pwd, PASSWORD_DEFAULT); $mysql = (include '../../config.php'); $sql1 = "CREATE TABLE swift_admin (id INTEGER NOT NULL AUTO_INCREMENT, username VARCHAR(100) NOT NULL, password VARCHAR(255) NOT NULL, active TINYINT(1) DEFAULT 1, PRIMARY KEY(id), CONSTRAINT sw_unq UNIQUE (username))"; $sql2 = "INSERT INTO swift_admin (username, password) VALUES ('{$user}', '{$pass}')"; $sql3 = "CREATE TABLE swift_logs (id INTEGER NOT NULL AUTO_INCREMENT, username VARCHAR(100), ip VARCHAR(15), action VARCHAR(255), time VARCHAR(255), PRIMARY KEY(id))"; $sql4 = "INSERT INTO swift_logs (username, ip, action, time) VALUES ('{$user}', '{$ip}', 'Installed Swiftproject!', '" . time() . "')"; $sql5 = "CREATE TABLE swift_servers (id INTEGER NOT NULL AUTO_INCREMENT, name VARCHAR(100), players VARCHAR(25), port INTEGER, owner_id INTEGER NOT NULL, host_id INTEGER NOT NULL, account VARCHAR(100), password VARCHAR(100), active TINYINT(1) DEFAULT 1, script VARCHAR(500), PRIMARY KEY(id), CONSTRAINT unique_name UNIQUE(name))"; $sql6 = "CREATE TABLE swift_users (id INTEGER NOT NULL AUTO_INCREMENT, username VARCHAR(100) NOT NULL, password VARCHAR(255) NOT NULL, active TINYINT(1) DEFAULT 1, PRIMARY KEY(id), CONSTRAINT swu_unq UNIQUE (username))"; $sql7 = "CREATE TABLE swift_hosts (id INTEGER NOT NULL AUTO_INCREMENT, name VARCHAR(100), ip VARCHAR(50) NOT NULL, sshport INTEGER, user VARCHAR(100) NOT NULL, pass VARCHAR(100) NOT NULL, islinux TINYINT(1), PRIMARY KEY(id), CONSTRAINT sw_hunq UNIQUE(ip))"; $sql8 = "CREATE TABLE swift_loginlog(id INTEGER NOT NULL AUTO_INCREMENT, user VARCHAR(100), ip VARCHAR(15), date VARCHAR(50), PRIMARY KEY(id))"; $sql9 = "CREATE TABLE swift_game(id INTEGER NOT NULL AUTO_INCREMENT, name VARCHAR(100), location VARCHAR(100), startcmd VARCHAR(255), islinux TINYINT(1), PRIMARY KEY(id))"; $sql10 = "CREATE TABLE swift_alert (id INTEGER NOT NULL AUTO_INCREMENT, srvid INTEGER NOT NULL, text VARCHAR(255) NOT NULL, PRIMARY KEY(id))"; $result = mysqli_query($mysql, $sql1); if (!$result) { die(mysqli_error($mysql)); } $result = mysqli_query($mysql, $sql2); if (!$result) {
addAccountUsername($s['id'], $canon ? $canon : $openid, $openid); $addition = true; } $_SESSION["acct_auth"] = true; $_SESSION["acct_username"] = $openid; $_SESSION["acct_sreg"] = $sreg; if (isset($canon)) { $_SESSION["acct_canon"] = $canon; } else { unset($_SESSION["acct_canon"]); } $_SESSION["acct_official"] = $_SESSION["acct_canon"] ? $_SESSION["acct_canon"] : $_SESSION["acct_username"]; if (!$addition) { $account = findAccount($_SESSION["acct_official"]); if ($account === false) { $id = createAccount(); addAccountUsername($id, $_SESSION["acct_official"], $_SESSION["acct_username"]); setAccountDetails($id, $sreg); if (isset($_COOKIE["pbguid"])) { setAccountGUID($id, $_COOKIE["pbguid"]); } setAccountAPIKey($id, makeApiKey()); $account = findAccount($_SESSION["acct_official"]); } else { pg_Exec($DB, "UPDATE accounts SET last_login=now() WHERE id=" . $account['id']); } $_SESSION["acct_id"] = $account['id']; $_SESSION["acct_sreg"] = $account; $_SESSION["kvp"] = findAccountKVP($account['id']); } else { pageHeader(_("new OpenID associated"));
<?php require 'db_connect.inc.php'; $connect = mysqli_connect(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME); if (mysqli_connect_errno()) { showJson(10, "Cannot connect with MySql :" . mysqli_connect_errno()); mysqli_close($connect); } else { //Successfully connected if (isset($_POST['name']) && isset($_POST['email']) && isset($_POST['password'])) { $name = $_POST['name']; $email = $_POST['email']; $password = $_POST['password']; if (!empty($name) && !empty($email) && !empty($password)) { if (getUserId($connect, $email) === 0) { if (createAccount($connect, $name, $email, $password) == 1) { sendEmailConfirmation($email); $id = getUserId($connect, $email); $response = array(); $response['status'] = 1; $response['message'] = "Account Created"; $response['user_id'] = $id; echo json_encode($response); } else { showJson(0, "Oops!...Details cannot be added into Database.Try again later."); die; } } else { showJson(3, "Email has already been registered."); } } else {
<?php /* * SLOC API */ // set time zone date_default_timezone_set('Europe/Lisbon'); // get the function parameter from URL $params = $_REQUEST; switch ($params['func']) { case 'createAccount': createAccount($params); break; case 'signUp': signUp($params); break; case 'signUpAndMetaInfo': signUpAndMetaInfo($params); break; case 'metaInfo': metaInfo($params); break; case 'createDataFile': createDataInFile($params); break; case 'checkIn': checkIn($params); break; case 'setLocationData': setLocationData($params); break;
// Create the user in OpenQwaq $uid = createUser($form); $user = $form; } else { $uid = $user['id']; } $acct = findAccountByUserAndOrg($uid, $orgid); if (isset($acct)) { // skip it var_dump($acct); } else { $acct["userid"] = $user["id"]; $acct["userName"] = $user["name"]; $acct["orgid"] = $org["id"]; $acct["orgName"] = $org["name"]; $acct["role"] = $_POST["role"]; $acct["status"] = "Invited"; $id = createAccount($acct); echo "<tr>"; echo "<td>{$form['name']}</td>"; echo "<td>{$form['email']}</td>"; echo "<td>{$form['firstName']}</td>"; echo "<td>{$form['lastName']}</td>"; echo "</tr>"; } } } echo "</table>"; } else { echo (string) $xml; }
//echo $response['result']; } else { echo $response['error']; die; } } else { if (isset($_GET['code']) && isset($_GET['shop'])) { $config = array('client_Id' => APIKEY, 'code' => $_GET['code'], 'redirect_uri' => REDIRECT_URL, 'client_Secret' => SECRET, 'url' => $STORE_URL); } else { $config = array('client_Id' => APIKEY, 'redirect_uri' => REDIRECT_URL, 'url' => $STORE_URL); } $productFeed = new shopify($config); $response = $productFeed->getAccessToken(); if ($response['status']) { $data = array('token' => $response['token'], 'shop' => $STORE_URL); $response = createAccount($data); if ($response['status']) { $response = $productFeed->registerShopifyAppUninstallWebhook(); if (!$response['status']) { echo $response['error']; die; } } else { echo $response['error']; die; } } else { echo $response['error']; die; } }
<?php include 'includes/header.php'; ?> <h1></h1> <?php if (isset($_GET['action'])) { switch (strtolower($_GET['action'])) { case 'register': // If the form was submitted lets try to create the account. if (isset($_POST['username']) && isset($_POST['password']) && isset($_POST['email'])) { if (createAccount($_POST['username'], $_POST['password'], $_POST['email'])) { $sOutput .= '<h2>Account Created</h2><br><h5>Your account has been created. You can now login <a href="login.php">here</a></h5>.'; } else { // unset the action to display the registration form. unset($_GET['action']); } } else { $_SESSION['error'] = "Username and or Password was not supplied."; unset($_GET['action']); } break; } } // If the user is logged in display them a message. if (loggedIn()) { $sOutput .= '<h2>Already Registered</h2> You have already registered and are currently logged in as: ' . $_SESSION['username'] . '. <h4>Would you like to <a href="login.php?action=logout">logout</a>?</h4>
} if (!$email || $mode != 'forgot' && !$password || $mode == 'create' && !$password2) { return '<span class="error">All fields are required.</span>'; } if (strpos($email, "@") === false) { return '<span class="error">That\'s not a valid email address.</span>'; } if ($mode == 'create' && $password != $password2) { return '<span class="error">Those passwords don\'t match.</span>'; } } if ($mode) { $message = validate(); if (!$message) { if ($mode == 'create') { if (!($userid = createAccount($email, $password))) { $message = '<span class="error">That email is already taken.</span>'; } } else { if ($mode == 'login') { $rslt = login($email, $password); if ($rslt == 'email') { $message = '<span class="error">No user with that email address.</span>'; } else { if ($rslt == 'password') { $message = '<span class="error">Wrong password.</span>'; } else { $userid = $rslt; } } } else {
//check for required variables if (!isset($action)) { $resp = array("status" => "fail", "reason" => "please send an action"); echo json_encode($resp); return; } if (!isset($email)) { $resp = array("status" => "fail", "reason" => "please send an email"); echo json_encode($resp); return; } if (!isset($passwd)) { $resp = array("status" => "fail", "reason" => "please send a passwd"); echo json_encode($resp); return; } //see the action and act accordingly switch ($action) { case "add": $resp = createAccount($inputArr); echo json_encode($resp); break; case "login": $resp = loginUser($email, $passwd); echo json_encode($resp); break; default: $resp = array("status" => "fail", "reason" => "please send a valid action"); echo json_encode($resp); break; }
<?php require_once "../config.php"; require_once "projects.php"; require_once filepath() . "app/auth.php"; if (isset($_POST['login'])) { if (authorize($_POST['email'])) { } else { redirect(sitepath()); } } else { if (isset($_POST["register"])) { createAccount($_POST['email'], $_POST['name']); } else { if (checkAuth()) { } else { redirect(sitepath()); } } } if (isset($_POST["projectToDelete"])) { deleteProject($_POST["projectToDelete"]); } ?> <html> <head> <?php head(); ?> <script type="text/javascript" src="project.js"></script>
function importUsersToCompanies($anArray) { global $lastError; $results = array(); //remove comments added to the import file - they start with # $noCommentArray = array(); foreach ($anArray as $record) { if ($record[0][0] != '#') { $noCommentArray[] = $record; } } $companies = getCompanyInformation($noCommentArray); foreach ($noCommentArray as $record) { $values = array(); $values['name'] = $record[1]; $password = $record[2]; if ($password == "") { $password = randomPassword(); } $values['password'] = $password; $values['email'] = $record[1]; $values['status'] = 'ActiveUser'; $values['firstName'] = $record[3]; $values['lastName'] = $record[4]; $values['company'] = $record[0]; $values['companyInfo'] = $companies[$values['company']]; $values['comment'] = $record[6]; $values['sendEmail'] = strtolower($record[7]) == 'true'; $values['role'] = $record[5]; if ($values['role'] == 'member' or strtolower($values['role']) == 'regular user') { $values['role'] = 'user'; } $values['id'] = createUser($values); if (!isset($values['id'])) { $values['createUserError'] = $lastError; $values['id'] = findUserByName($record[1]); $values['id'] = $values['id']['id']; } else { $rs = updateUser($values['id'], $values); if (!$rs) { $values['createUserError'] = 'Could not create password'; } } $result[$record[1]] = $values; } foreach ($result as $user => $values) { global $lastError; $accountValues = array(); $accountValues['userid'] = $values['id']; $accountValues['orgid'] = $values['companyInfo']['id']; $accountValues['userName'] = $user; $accountValues['orgName'] = $values['company']; $accountValues['status'] = 'Invited'; $accountValues['role'] = $values['role']; $accountValues['type'] = 'user'; if (isset($accountValues['orgid']) and isset($accountValues['userid'])) { $accountValues['id'] = createAccount($accountValues); } else { $lastError = '<b>Error: </b>Cannot add ' . $user . ' to ' . $values['company'] . ' because the company does not exist. Please create the company first'; } if (isset($accountValues['id'])) { if ($values['sendEmail']) { sendActivationRequest('', $values); } } else { $accountValues['createAccountError'] = $lastError; } $result[$user]['accounts'][$accountValues['orgName']] = $accountValues; } return $result; }
} else { if (!isset($_POST['action'])) { $_POST['action'] = "undefined"; } $action = $_POST['action']; if ($action == 'apply_account') { $username = $_POST['username']; $g_user = safeUserName($username); $email = $_POST['email']; //$letter = $_POST['letter']; $pswd = $_POST['pswd']; $g_pswd = safeUserName($pswd); // $letter = safeText3($letter); $c_a_r = 0; $c_a_r = createApplication($g_user, $email, $g_pswd); $c_a_r = $c_a_r + createAccount($g_user, $g_pswd); } } //==================================================== // HTML functions //==================================================== //******************************************** function viking_7_mainmenu($sys_id) { global $par; $path = $par['path']; $user = $par['user']; //$submenu = $par['a7_submenu']; //if(!$submenu) $submenu = 1; echo "<ul id=\"dropdown\">"; echo "<li><a href=\"{$path}\">File</a>";
if (!empty($error)) { header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/createaccount.php?username={$username}&fullname={$fullname}&email={$email}&email2={$email2}&error=" . urlencode($error)); exit; } //create an activation code /* there may be a better way to do this. My thought is that md5 gives me a string that is pretty random and long enough that it is essentially impossible to guess. By seeding it with microtime and username the key should be different for each user it would take a couple of thousand guesses to get a match if you tried to brute force create every possible activationKey for the time around when the attackers account was created. */ $activationCode = md5(microtime() . $username); // create the actual account $encryptedPassword = createPassword($username, $password); if (!createAccount($username, $encryptedPassword, $fullname, $domain, $email, $activationCode)) { // oops ... got an error creating the account $error = $error . "Error while creating account."; header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/createaccount.php?username={$username}&fullname={$fullname}&email={$email}&email2={$email2}&error=" . urlencode($error)); exit; } // create a default resource $defaultAOR = $username . '@' . $domain; if (!createResource($username, $defaultAOR, 'N', '', '')) { // oops ... got an error creating the default resource $error = $error . "Error while creating account (default resource)."; header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/createaccount.php?username={$username}&fullname={$fullname}&email={$email}&email2={$email2}&error=" . urlencode($error)); exit; } // email the activation notice // create activation link
function changeStatus($sub_id, $action) { $order = $this->orders->get("WHERE `orders`.sub_id=" . intval($sub_id)); $order_data = $order[0]; $order_data['dom_user'] = strtolower($order_data['dom_user']); $order_data['dom_pass'] = $this->utils->alpencrypt->decrypt($order_data['dom_pass'], $this->props->encryptionKey); $status = $order_data['cust_status']; $condition = "LEFT JOIN `cpanel_reseller_profiles` ON `cpanel_reseller_profiles`.cpr_profile_id=`products`.cpr_profile_id " . "LEFT JOIN `plesk_profiles` ON `plesk_profiles`.plesk_profile_id =`products`.plesk_profile_id " . "WHERE `products`.plan_price_id=" . intval($order_data['product_id']); $product = $this->products->hasAnyOne(array($condition)); $acc_method = $product['acc_method']; $product_id = $product['plan_price_id']; if ($product_id > 0 && $acc_method > 0) { $server = $this->getServerForProduct($product_id); //check and correction for cpanel if ($server['server_type'] == "cpanel" && ($server['server_user'] != "root" && !preg_match('|' . $server['server_user'] . "_|i", $product['plan_name']) || preg_match("/ /", $product['plan_name']))) { $this->syncPackage($product_id); $product = $this->products->hasAnyOne(array($condition)); } //Get plesk id if its a plesk order if ($server['server_type'] == "plesk") { $temp = $this->plesk_ids->hasAnyOne(array("WHERE `cust_id`=" . intval($order_data['id']))); $order_data['plesk_id'] = $temp['plesk_id']; } if (!empty($server['server_type']) && $server['server_auto'] == "yes" && $server['server_type'] != "other") { $serverHandler = null; $plugin_file = $this->props->get_page("plugins/controlpanels/" . $server['server_type'] . ".php", "file", 1); if (is_readable($plugin_file)) { require_once $plugin_file; } else { return $plugin_file . " " . $this->props->lang['not_readable']; } $plugin_name = $server['server_type']; $plugin_name = $plugin_name . "Handler"; if (isset($this->{$plugin_name})) { $serverHandler =& $this->{$plugin_name}; } //call functions $ip_id = 0; $server_id = $server['server_id']; $host = $server['server_ip']; $user = $server['server_user']; $password = $this->utils->alpencrypt->decrypt($server['server_pass'], $this->props->encryptionKey); $accesshash = $this->utils->alpencrypt->decrypt($server['server_hash'], $this->props->encryptionKey); $usessl = $server['server_ssl'] == "yes" ? 1 : 0; $order_data['ns1'] = $server['name_server_1']; $order_data['ns2'] = $server['name_server_2']; ///Activate order if ($action == "create") { $result = createAccount($host, $user, $password, $usessl, $product, $order_data, $serverHandler, $accesshash); $this->cp_message = $result['response']; if ($result['result'] == 1) { $status = 1; $sql = "UPDATE {$this->props->tbl_servers} SET `current_accounts`=(`current_accounts`+1) WHERE `server_id`=" . intval($server_id) . ""; $this->dbL->executeUPDATE($sql); $addi_ips = array(); $temp = $this->servers->additionalIPs($server_id); foreach ($temp as $t) { $addi_ips[$t['ip_id']] = $t['ip']; } $ip_id = array_search($result['ip_address'], $addi_ips); if ($ip_id === false && !empty($result['result'])) { $ip = $result['ip_address']; $ip_id = $this->ips->insert(array("server_id" => $server_id, "ip" => $ip)); } //Store plesk if if ($server['server_type'] == "plesk") { $cust_id = $order_data['parent_id']; $plesk_id = $result['plesk_id']; $this->plesk_ids->insert(array("cust_id" => $cust_id, "plesk_id" => $plesk_id)); } $sqlSELECT1 = "SELECT * FROM {$this->props->tbl_orders_servers_ips} WHERE `sub_id`=" . intval($sub_id); if (count($this->dbL->executeSELECT($sqlSELECT1))) { if (!empty($ip_id)) { $str = "`ip_id`=" . intval($ip_id) . ","; } $sql = "UPDATE {$this->props->tbl_orders_servers_ips} SET `server_id`=" . intval($server_id) . ", " . $str . " `acct_status`='" . intval($status) . "' WHERE `sub_id`=" . intval($sub_id); $this->dbL->executeUPDATE($sql); } else { if (!empty($ip_id)) { $str = intval($ip_id) . ","; } $sql = "INSERT INTO {$this->props->tbl_orders_servers_ips} VALUES(" . intval($sub_id) . "," . intval($server_id) . "," . $str . "'" . intval($status) . "')"; $this->dbL->executeINSERT($sql); } $this->markAccounts($sub_id, "_" . $action); $this->mailNotice($sub_id, "ACTIVE"); } } elseif ($action == "suspend") { $result = suspendAccount($host, $user, $password, $usessl, $order_data, $serverHandler, $accesshash); $this->cp_message = $result['response']; if ($result['result'] == 1) { $status = 2; $this->markAccounts($sub_id, "_" . $action); $this->mailNotice($sub_id, "SUSPEND"); } } elseif ($action == "unsuspend") { $result = unsuspendAccount($host, $user, $password, $usessl, $order_data, $serverHandler, $accesshash); $this->cp_message = $result['response']; if ($result['result'] == 1) { $status = 1; $this->markAccounts($sub_id, "_" . $action); $this->mailNotice($sub_id, "ACTIVE"); } } elseif ($action == "kill") { $result = killAccount($host, $user, $password, $usessl, $order_data, $serverHandler, $accesshash); $this->cp_message = $result['response']; if ($result['result'] == 1) { $status = 0; $sqlUPDATE = "UPDATE {$this->props->tbl_servers} SET `current_accounts`=(`current_accounts`-1) WHERE `server_id`=" . intval($server_id) . ""; $this->dbL->executeUPDATE($sqlUPDATE); //Del plesk if if ($server['server_type'] == "plesk") { $cust_id = $order_data['parent_id']; $this->plesk_ids->delete(array("WHERE `cust_id`=" . intval($cust_id))); } $this->markAccounts($sub_id, "_" . $action); } } } if (empty($this->props->order_status[$status])) { $status = 0; } $sqlUPDATE = "UPDATE {$this->props->tbl_orders} SET `cust_status`='" . $this->props->order_status[$status] . "' WHERE `sub_id`=" . intval($sub_id); $this->dbL->executeUPDATE($sqlUPDATE); $this->orders->update(array("cust_status" => $this->props->order_status[$status], "sub_id" => $sub_id)); $this->cp_message = isset($this->cp_message) ? $this->cp_message : ''; $this->cp_message = trim($this->cp_message); if (empty($this->cp_message)) { $this->cp_message = $this->props->lang['No_respose_from_server']; } return $this->cp_message; } return $this->props->lang['either_product_doesnot_exist']; }
<?php include '../shared/shared.php'; $password = $_POST['password']; $username = $_POST['username']; if (createAccount($username, $password)) { header("Status: 204 No Data"); } else { header("Status: 409 Conflict"); }
<?php include "ShopAnytimeMVC.php"; if (isset($_GET['username'])) { $user = checkUsername($_GET['username']); if (count($user) < 1) { print "valid"; } else { print "invalid"; } } if ($_POST) { $fname = $_POST['firstnameRegister']; $lname = $_POST['lastnameRegister']; $add = $_POST['addressRegister']; $uname = $_POST['usernameRegister']; $pwd = $_POST['passwordRegister']; createAccount($fname, $lname, $add, $uname, $pwd); header("Location: /eio/Assignment6/ShopAnytimeHome.php?Register='success'"); exit; } ?>
$respo = false; if (isset($_POST["collabo_permission_check_respo"]) && $_POST["collabo_permission_check_respo"] == "check") { $respo = true; $current = 3; } $admin = false; if (isset($_POST["collabo_permission_check_admin"]) && $_POST["collabo_permission_check_admin"] == "check") { $admin = true; $current = 2; } if ($current == 0) { $collabo = true; $current = 4; } // ($nom, $prenom, $adresse, $userPassword, $telephone, $mail, $firstRole) $collaboId = createAccount($_POST["collabo_name_field"], $_POST["collabo_firstname_field"], $_POST["collabo_address_field"], $_POST["collabo_phone_field"], $_POST["collabo_password_field"], $_POST["collabo_email_field"], $current); if ($collaboId > 0) { $_SESSION["collabo"] = $collaboId; if (synchroniseRole($collaboId, $collabo, $respo, $admin)) { // TO DO: affiché une réussite } else { // TO DO: gestion des erreurs } } else { // TO DO: gestion des erreurs } break; case $ACTION_collaboDelete: // commence par réalouer les // les projets for ($i = 0; $i < $_POST["nbRespo"]; $i++) {
<?php require $_SERVER['DOCUMENT_ROOT'] . '/crm-native/includes/config.php'; if (isset($_GET['action'])) { switch (strtolower($_GET['action'])) { case 'register': // If the form was submitted lets try to create the account. if (isset($_POST['username']) && isset($_POST['pass'])) { if (createAccount($_POST['username'], $_POST['pass'])) { $sOutput .= '<html><script> window.alert("Account Created") window.location.href="login.php"; </SCRIPT></html>'; } else { // unset the action to display the registration form. unset($_GET['action']); } } else { echo "Username and or Password was not supplied."; unset($_GET['action']); } break; } } else { $sError = ""; if (isset($_SESSION['error'])) { $sError = '<span id="error">error</span><br />'; echo $sError; } }