Exemple #1
0
 function Reg($username, $email, $pass, $plan, $transfer, $invite_num, $ref_by, $node)
 {
     $sspass = \Ss\Etc\Comm::get_random_char(8);
     $uid = $this->db->insert($this->table, ["user_name" => $username, "email" => $email, "pass" => $pass, "passwd" => $sspass, "node_id" => $node, "t" => '0', "u" => '0', "d" => '0', "plan" => $plan, "transfer_enable" => $transfer, "port" => $this->GetLastPort(), "invite_num" => $invite_num, "money" => '0', "#reg_date" => 'NOW()', "ref_by" => $ref_by, "f_adfilter" => 0]);
     if (true) {
         $ssh = new \Ss\User\Ssh();
         $ssh = $ssh->getUnallocated();
         $ssh->allocat($uid);
     }
 }
Exemple #2
0
 function Reg($username, $email, $pass, $plan, $transfer, $invite_num, $ref_by)
 {
     $sspass = \Ss\Etc\Comm::get_random_char(8);
     $ssport = $this->GetLastPort() + rand(1, 5);
     $this->db->insert($this->table, ["user_name" => $username, "email" => $email, "pass" => $pass, "passwd" => $sspass, "t" => '0', "u" => '0', "d" => '0', "plan" => $plan, "transfer_enable" => $transfer, "port" => $ssport, "invite_num" => $invite_num, "money" => '0', "#reg_date" => 'NOW()', "ref_by" => $ref_by]);
     //add one registered user to radcheck
     $this->db->insert(radcheck, ["username" => $ssport, "attribute" => 'Cleartext-Password', "op" => ':=', "value" => $sspass]);
     //add one registered user to specific usergroup
     $this->db->insert(radusergroup, ["username" => $ssport, "groupname" => $plan, "priority" => '1']);
     //END OF Reg Function ReWritten by Mr. Fang;)
     //TODO:customization of priority, grouping by server
 }
Exemple #3
0
 function Reg($username, $email, $pass, $plan, $transfer, $invite_num, $ref_by, $role, $inviter, $question, $answer)
 {
     if ($inviter != 0) {
         $transfer = $transfer + 1073741824;
     }
     $sspass = \Ss\Etc\Comm::get_random_char(8);
     $this->db->insert($this->table, ["user_name" => $username, "email" => $email, "pass" => $pass, "passwd" => $sspass, "t" => '0', "u" => '0', "d" => '0', "plan" => $plan, "transfer_enable" => $transfer, "port" => $this->GetLastPort() + 1, "invite_num" => $invite_num, "money" => '0', "#reg_date" => 'NOW()', "ref_by" => $ref_by, "invite_by" => $inviter, "role" => $role, "question" => $question, "answer" => $answer]);
     /*
     if($inviter != 0){
         $query = $this->db->query("SELECT * FROM user WHERE `uid`={$inviter}");
         $result = mysqli_fetch_array($query,MYSQLI_ASSOC);
         //$able = intval($result['transfer_enable'])+$this->gigabytes;
         $able = $result['transfer_enable'];
         $this->db->query("UPDATE user SET `transfer_enable` = $able WHERE uid = $inviter");
     }
     */
 }
<?php

//开启session
session_start();
require_once '../lib/config.php';
require_once '_check.php';
//引入AES
require_once '../lib/Ss/AES/aes.class.php';
require_once '../lib/Ss/AES/aesctr.class.php';
$newpwd = AesCtr::decrypt($_POST['sspwd'], $_SESSION['randomChar'], 256);
if ($oo->get_enable()) {
    if ($newpwd == '') {
        $pwd = \Ss\Etc\Comm::get_random_char(8);
    } else {
        $pwd = $newpwd;
        $pwd = htmlspecialchars($pwd, ENT_QUOTES, 'UTF-8');
        $pwd = \Ss\Etc\Comm::checkHtml($pwd);
    }
    $oo->update_ss_pass($pwd);
    $a['ok'] = '1';
    $a['msg'] = "新密码为" . $pwd;
} else {
    $a['code'] = '0';
    $a['msg'] = "你的SS服务已被停止,无法修改Shadowsocks连接密码。";
}
echo json_encode($a, JSON_UNESCAPED_UNICODE);
Exemple #5
0
    ?>
</td>
                                        <td><?php 
    echo $rs['port'];
    ?>
</td>
                                        <td><?php 
    \Ss\Etc\Comm::flowAutoShow($rs['transfer_enable']);
    ?>
</td>
                                        <td><?php 
    \Ss\Etc\Comm::flowAutoShow($rs['transfer_enable'] - $rs['u'] - $rs['d']);
    ?>
</td>
                                        <td><?php 
    \Ss\Etc\Comm::flowAutoShow($rs['u'] + $rs['d']);
    ?>
</td>
                                        <td><?php 
    echo date('Y-m-d H:i:s', $rs['last_check_in_time']);
    ?>
</td>
                                        <td>
                                            <a class="btn btn-info btn-sm" href="user_edit.php?uid=<?php 
    echo $rs['uid'];
    ?>
">查看</a>
                                            <a class="btn btn-danger btn-sm" href="user_del.php?uid=<?php 
    echo $rs['uid'];
    ?>
" onclick="JavaScript:return confirm('确定删除吗?')">删除</a>
Exemple #6
0
<?php

//引入配置文件
require_once '../lib/config.php';
require_once '_check.php';
$uid = $_GET['uid'];
$u = new \Ss\User\UserInfo($uid);
$u->UpdatePwd(\Ss\Etc\Comm::get_random_char(8));
$u->DelMe();
echo ' <script>alert("删除成功!")</script> ';
echo " <script>window.location='user.php';</script> ";
Exemple #7
0
<?php

require_once '../lib/config.php';
require_once '_check.php';
// $pwd = $_POST['sspwd'];
if ($_POST['sspwd'] == '') {
    $pwd = \Ss\Etc\Comm::get_random_char(8);
} else {
    $pwd = $_POST['sspwd'];
    $pwd = htmlspecialchars(strip_tags($pwd));
}
$oo->update_ss_pass($pwd);
$a['ok'] = '1';
$a['msg'] = "新密码为" . $pwd;
echo json_encode($a);
Exemple #8
0
 function Reg($username, $email, $pass, $plan, $transfer, $invite_num, $ref_by)
 {
     $sspass = \Ss\Etc\Comm::get_random_char(8);
     $this->db->insert($this->table, ["user_name" => $username, "email" => $email, "pass" => $pass, "passwd" => $sspass, "t" => '0', "u" => '0', "d" => '0', "plan" => $plan, "transfer_enable" => $transfer, "port" => $this->GetLastPort() + rand(1, 5), "invite_num" => $invite_num, "money" => '0', "#reg_date" => 'NOW()', "ref_by" => $ref_by]);
 }