浏览代码

Subuser Expiration Date Affected By Main User's Expiration Date

own3mall 6 年之前
父节点
当前提交
9bab203f12
共有 2 个文件被更改,包括 14 次插入0 次删除
  1. 9 0
      home.php
  2. 5 0
      modules/user_admin/show_users.php

+ 9 - 0
home.php

@@ -99,6 +99,15 @@ function heading()
     else
     {
         $info = $db->getUserById($_SESSION['user_id']);
+        
+        // Use parent expiration date for subusers
+		if(!is_null($row['users_parent']) && is_numeric($row['users_parent'])){
+			$parentInfo = $db->getUserById($row['users_parent']);
+			if(is_array($parentInfo) && array_key_exists("user_expires", $parentInfo) && $parentInfo['user_expires'] != "X"){
+				$info['user_expires'] = $parentInfo['user_expires'];
+			}
+		}
+        
 		if($info['user_expires'] != "X")
 		{
 			list($days,$strd,$hours,$strh,$minutes,$strm) = explode(" ", read_expire($info['user_expires']));

+ 5 - 0
modules/user_admin/show_users.php

@@ -96,7 +96,12 @@ function exec_ogp_module() {
 		$ownedBy = "";
 		if(!is_null($row['users_parent'])){
 			$ownedBy = $row['users_parent'];
+			$parentInfo = $db->getUserById($ownedBy);
+			if(is_array($parentInfo) && array_key_exists("user_expires", $parentInfo) && $parentInfo['user_expires'] != "X"){
+				$row['user_expires'] = $parentInfo['user_expires'];
+			}
 		}
+		
         $user_expires = read_expire($row['user_expires']);
         print "<tr class='tr".($i++%2)." ";
         print $row['users_role'] . " ";