Beispiel #1
0
 /**
  * 获取用户及空间信息
  * @return array
  */
 public function getProfile()
 {
     $data = array();
     $data['id'] = $this->user['id'];
     $data['display_name'] = $this->user['nick'];
     $data['user_name'] = $this->user['user_name'];
     $data['avatar'] = $this->user['avatar'];
     $data['nick'] = $this->user['nick'];
     $data['email'] = $this->user['email'];
     $data['space'] = $this->user['space'];
     $data['usedSpace'] = $this->user['usedSpace'];
     $data['used_space'] = $this->user['usedSpace'];
     $data['email'] = $this->user['email'];
     $data['phone'] = $this->user['phone'];
     //这里的信息比较冗余,把站点的逻辑融入到用户信息获得的地方,是为了不让PC客户端发送多次请求
     //打印用户是否是管理员
     $info = array("success" => $this->user["is_admin"]);
     $data['is_admin'] = $info;
     //输出服务器时间
     $info = array("time" => time());
     $data['time'] = $info;
     //获得站点信息
     $app = new SiteService();
     $data['app_info'] = $app->info();
     //是否系统只有默认账号
     $data['only_default_account'] = $app->onlyDefaultAccount();
     //获得授权码信息
     $code = MiniOption::getInstance()->getOptionValue("code");
     if (empty($code)) {
         $code = "";
     }
     $data['code'] = $code;
     return $data;
 }
Beispiel #2
0
 /**
  * 获得站点信息,获得自定义的名称与Logo
  * @return array|null
  */
 public function getSiteInfo()
 {
     $app = new SiteService();
     return $app->info();
 }