Exemple #1
0
<script type="text/javascript">
	//当前主题
	Mo.store.model	= "<?php 
echo $config['ui-model'] ? $config['ui-model'] : 'modern';
?>
";	
	
	//当前主题
	Mo.store.theme	= "<?php 
echo $_G['manager']['theme'];
?>
";
	
	//当前头像
	Mo.store.avatar	= "<?php 
echo fix_thumb($_G['manager']['avatar']);
?>
";

	//当前UID
	Mo.store.aid	= "<?php 
echo $_G['manager']['id'];
?>
";
		
	//当前用户
	Mo.store.account= "<?php 
echo $_G['manager']['account'];
?>
";
		
Exemple #2
0
     if ($_G['manager']['id']) {
         //查询用户最后登录时间
         $sql = "SELECT last_login from `sys:admin` WHERE id=" . $_G['manager']['id'] . " AND `state`>0";
         //时间
         $last = System::$db->getValue($sql);
         if ($last) {
             //更新用户最后活动时间
             $sql = "UPDATE `sys:admin` SET last_active=" . time() . " WHERE id=" . $_G['manager']['id'];
             System::$db->execute($sql);
             //写入日志
             $sql = "UPDATE `sys:event` SET `modify`=" . time() . ",ip='" . GetIP() . "' WHERE aid=" . $_G['manager']['id'] . " AND event='login' AND dateline='" . $last . "'";
             System::$db->execute($sql);
         }
     }
     //返回数据
     echo $callback . '({ "id":"' . $_G['manager']['id'] . '", "account":"' . $_G['manager']['account'] . '", "avatar":"' . fix_thumb($_G['manager']["avatar"]) . '", "group":"' . $_CACHE['system']['group'][$_G['manager']["gid"]]["name"] . '" });';
     break;
     /////////////////////////////////////////////
     //退出登录
 /////////////////////////////////////////////
 //退出登录
 case "logout":
     if ($_G['manager']['id']) {
         unset($_SESSION['manager'], $_G['manager']);
     }
     //返回数据
     echo $callback . '( true );';
     break;
     /////////////////////////////////////////////
     //设置主题
 /////////////////////////////////////////////
Exemple #3
0
&jump={self}">
			
				<td width="30">
				<?php 
    echo (time() - $row["last_active"] > 30 ? '<a href="?line=off">' . loader_image("icon/offline.png", "离线") . '</a>' : '<a href="?line=on">' . loader_image("icon/online.png", "在线")) . '</a>';
    ?>
				
				<div id="card-<?php 
    echo $row['id'];
    ?>
" style="display:none;">
				
					<table border="0" cellpadding="0" cellspacing="0">
					  <tr>
						<td rowspan="2" width="60"><img src="<?php 
    echo fix_thumb($row["avatar"]);
    ?>
" class="avatar" /></td>
						<td><strong><?php 
    echo $row['account'];
    ?>
</strong></td>
					  </tr>
					  <tr>
						<td>
							<?php 
    echo $row["gender"] ? loader_image("icon/male.png", "男士") : loader_image("icon/female.png", "女士");
    ?>
							<?php 
    $bdmonth = date("m", strtotime($row["birthday"]));
    $bdday = date("d", strtotime($row["birthday"]));
Exemple #4
0
 public static function delete_remote($file, $param)
 {
     global $_G;
     require VI_ROOT . 'source/class/ftp.php';
     //转换成相对路径
     $file = str_replace($_G['setting']['attach']['FTP_SITE'], $_G['setting']['attach']['FTP_ROOT'], $file);
     //连接 FTP
     $ftp = new ClsFTP($_G['setting']["attach"]["FTP_USER"], $_G['setting']["attach"]["FTP_PASS"], $_G['setting']["attach"]["FTP_HOST"], $_G['setting']["attach"]["FTP_PORT"]);
     //FTP 模式
     $ftp->pasv($_G['setting']['attach']['FTP_PASV'] == 'true');
     if (in_array(fileext($file), $_G['upload']['image'])) {
         if ($param['thumb']) {
             //删除图片缩略图
             $thumb = fix_thumb($file);
             $ftp->delete($thumb);
         }
         if (is_array($param['group'])) {
             foreach ($param['group'] as $g) {
                 $thumb = explode("*", $g);
                 if (is_array($thumb)) {
                     //删除图片缩略图
                     $thumb = fix_thumb($file, $thumb);
                     $ftp->delete($thumb);
                 }
             }
         }
     }
     //删除文件
     $res = $ftp->delete($file);
     //关闭 FTP
     $ftp->close();
     return $res;
 }