Esempio n. 1
0
         }
         fclose($fr);
         if (!rename($file_write, '../inc/config.php')) {
             sendBack('Failed to move config file');
         }
     } else {
         if (!is_readable($file_read)) {
             die('Config file is not readable or writeable');
         }
     }
 } else {
     die('Config file does not exist');
 }
 ## Setup the random information for the original admin user ##
 $user_salt = genSalt(12);
 $user_pw = randPass(10);
 $pass_hash = genPw($user_pw, $user_salt);
 ## Add user to the database
 $result = $dbl->addUser('admin', 'Admin', $email, $pass_hash, $user_salt, 2, 1);
 if (!$result) {
     sendBack('Their was a problem adding the admin user to the admin tables, please check the users table exists in your Echelon database');
 }
 ## Send the admin their email ##
 $body = '<html><body>';
 $body .= '<h2>Echelon Admin User Information</h2>';
 $body .= 'This is the admin user login informtion.<br />';
 $body .= 'Username: <b>admin</b><br />';
 $body .= 'Password: <b>' . $user_pw . "</b><br />";
 $body .= 'If you have not already, please entirely remove the install folder from Echelon (/echelon/install/).<br />';
 $body .= 'Thank you for downloading and installing Echelon, <br />';
 $body .= 'The B3 Dev. Team';
Esempio n. 2
0
/**
 * Generates a new password salt
 *
 * @return string $salt
 */
function genSalt($length = 12)
{
    $salt = randPass($length);
    return $salt;
}
Esempio n. 3
0
function insertClientData($arrClientData)
{
    foreach ($arrClientData as $field_rank_client => $value_rank_client) {
        unset($_POST[$field_rank_client]);
        $_POST[$field_rank_client] = $value_rank_client;
    }
    //End foreach
    $_POST['rcl_status'] = 1;
    $_POST['rcl_resisted'] = 1;
    unset($_POST[rcl_id]);
    print DataJasInsertString('rank_client') . "<br /><br />";
    $intClientId = DataJasInsert('rank_client');
    //seo-rankingのユーザー名とパスワードの登録(update)
    //ユーザー名
    $prefix = "";
    if ($_POST[rcl_agencyflag] == "0") {
        $prefix = "A";
    }
    if ($_POST[rcl_agencyflag] == "1") {
        $prefix = "E";
    }
    if ($_POST[rcl_agencyflag] == "2") {
        $prefix = "A";
    }
    $username = $prefix . "-" . substr(DateNow(0), 2, 2) . substr(0, 5, 2) . "-" . substr("00000" . $intClientId, -5);
    //パスワード
    $pass = randPass(6);
    require 'cin/SQLConnect_jas.php';
    #	  	require('cin/SQLConnect.php');
    $sql = "UPDATE `rank_client` SET `rcl_username` = '" . $username . "', `rcl_password` = '" . $pass . "' WHERE (`rcl_id` = '" . $intClientId . "');";
    #15-02-13変更
    print $sql . "<BR><BR>";
    $c_hit = mysql_db_query($dbName, $sql) or die('UPDATE error: ' . mysql_errno() . ', ' . mysql_error());
    mysql_close($GLOBALS[dbHandle]);
    require 'cin/SQLClose.php';
    return $intClientId;
}
Esempio n. 4
0
    //既にseo-rankingのユーザーID、パスがある場合登録しない
    #		if(!(($row[rcl_username]) && ($row[rcl_password]))) {  #15-02-13変更
    //クライアントIDの発行
    //====================================================================
    $prefix = "";
    if ($_POST[rcl_agencyflag] == "0") {
        $prefix = "A";
    }
    if ($_POST[rcl_agencyflag] == "1") {
        $prefix = "E";
    }
    if ($_POST[rcl_agencyflag] == "2") {
        $prefix = "A";
    }
    $username = $prefix . "-" . substr(DateNow(0), 2, 2) . substr(0, 5, 2) . "-" . substr("00000" . $row[rcl_id], -5);
    $pass = randPass(6);
    require 'cin/SQLConnect_jas.php';
    #$sql = "UPDATE `rank_client` SET `rcl_username` = '" . $username . "', `rcl_password` = '" . $pass . "' WHERE (`rcl_name` = '" . $_POST[rcl_name] ."');";
    $sql = "UPDATE `rank_client` SET `rcl_username` = '" . $username . "', `rcl_password` = '" . $pass . "' WHERE (`rcl_id` = '" . $_POST[rcl_id] . "');";
    #15-02-13変更
    print $sql . "<BR><BR>";
    $c_hit = mysql_db_query($dbName, $sql) or die('UPDATE error: ' . mysql_errno() . ', ' . mysql_error());
    mysql_close($GLOBALS[dbHandle]);
    //====================================================================
    #		}//End if
} else {
    #$_POST[record]があるときUPDATEする
    require 'cin/SQLConnect_jas.php';
    $sql = " SELECT rcl_id FROM `rank_client` ";
    $sql .= " WHERE TRUE ";
    $sql .= " AND rcl_accountid = {$_POST[record]} ";