Merge pull request #1 from NimaQu/dev

merge upstream
no_ymq_dev
Rico 8 years ago committed by GitHub
commit e22ba164fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -593,8 +593,7 @@ class Job
Radius::Delete($user->email);
}
if (strtotime($user->expire_in) < time() && $user->transfer_enable > 0 ) {
if (strtotime($user->expire_in) < time()&&!file_exists(BASE_PATH."/storage/".$node->id.".expire_in")) {
$user->transfer_enable = 0;
$user->u = 0;
$user->d = 0;
@ -611,7 +610,15 @@ class Job
} catch (\Exception $e) {
echo $e->getMessage();
}
$myfile = fopen(BASE_PATH."/storage/".$node->id.".expire_in", "w+") or die("Unable to open file!");
$txt = "1";
fwrite($myfile, $txt);
fclose($myfile);
}
elseif (strtotime($user->expire_in) > time()&&file_exists(BASE_PATH."/storage/".$node->id.".expire_in")) {
unlink(BASE_PATH."/storage/".$node->id.".expire_in");
}
//余量不足检测
if(!file_exists(BASE_PATH."/storage/traffic_notified/")){

@ -311,10 +311,11 @@ class URL
}
public static function getAllUrl($user, $is_mu, $is_ss = 0, $enter = 0) {
$return_url = '';
if ($user->transfer_enable >0){
$return_url .= URL::getUserTraffic($user, $is_mu).($enter == 0 ? ' ' : "\n");
$return_url .= URL::getUserClassExpiration($user, $is_mu).($enter == 0 ? ' ' : "\n");
}
$return_url .= URL::getUserTraffic($user, $is_mu).($enter == 0 ? ' ' : "\n");
$return_url .= URL::getUserClassExpiration($user, $is_mu).($enter == 0 ? ' ' : "\n");
if(strtotime($user->expire_in)<time()){
return $return_url;
}
$items = URL::getAllItems($user, $is_mu, $is_ss);
foreach($items as $item) {
$return_url .= URL::getItemUrl($item, $is_ss).($enter == 0 ? ' ' : "\n");
@ -630,7 +631,7 @@ class URL
if(!Config::get('mergeSub') and $is_mu == 1){
$group_name .= ' - 单端口';
}
if(strtotime($user->class_expire)>time() || strtotime($user->class_expire) > 1420041600){
if(strtotime($user->expire_in)>time()){
$ssurl = "www.google.com:1:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=".Tools::base64_url_encode("剩余流量:".number_format(($user->transfer_enable-($user->u+$user->d))/$user->transfer_enable*100,2)."% ".$user->unusedTraffic())."&group=".Tools::base64_url_encode($group_name);
}else{
$ssurl = "www.google.com:1:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=".Tools::base64_url_encode("账户已过期,请续费后使用")."&group=".Tools::base64_url_encode($group_name);
@ -643,7 +644,7 @@ class URL
if(!Config::get('mergeSub') and $is_mu == 1){
$group_name .= ' - 单端口';
}
if(strtotime($user->class_expire)>time() || strtotime($user->class_expire) > 1420041600){
if(strtotime($user->expire_in)>time()){
$ssurl = "www.google.com:2:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=".Tools::base64_url_encode("过期时间:".$user->class_expire)."&group=".Tools::base64_url_encode($group_name);
}else{
$ssurl = "www.google.com:2:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=".Tools::base64_url_encode("账户已过期,请续费后使用")."&group=".Tools::base64_url_encode($group_name);

Loading…
Cancel
Save