diff --git a/module/action/model.php b/module/action/model.php index 5a67dbab75..9dfe977eb5 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -750,7 +750,7 @@ class actionModel extends model } $objectNames['user'][0] = 'guest'; // Add guest account. - foreach($actions as $action) + foreach($actions as $i => $action) { /* Add name field to the actions. */ $action->objectName = isset($objectNames[$action->objectType][$action->objectID]) ? $objectNames[$action->objectType][$action->objectID] : ''; @@ -779,11 +779,14 @@ class actionModel extends model { list($objectLabel, $moduleName, $methodName, $vars) = explode('|', $action->objectLabel); $action->objectLink = ''; - if(common::hasPriv($moduleName, $methodName)) + if(!common::hasPriv($moduleName, $methodName)) { - $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID)); - if($action->objectType == 'user') $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->actor)); + unset($actions[$i]); + continue; } + + $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID)); + if($action->objectType == 'user') $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->actor)); $action->objectLabel = $objectLabel; } else diff --git a/xuanxuan/module/admin/ext/control/xuanxuan.php b/xuanxuan/module/admin/ext/control/xuanxuan.php index c342ef46c0..904aa09f7b 100644 --- a/xuanxuan/module/admin/ext/control/xuanxuan.php +++ b/xuanxuan/module/admin/ext/control/xuanxuan.php @@ -29,9 +29,7 @@ class admin extends control if($errors) $this->send(array('result' => 'fail', 'message' => $errors)); - $result = $this->loadModel('setting')->setItems('system.common.xuanxuan', $setting); - $this->setting->setItem('system.mail.domain', $setting->server); if(!$result) $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('xuanxuan'))); } diff --git a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php index 04d2de620b..40d1de46b8 100644 --- a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php @@ -65,4 +65,28 @@ class xuanxuanChat extends chatModel unset($_SESSION['user']); return $entries; } + + public function editUser($user = null) + { + if(empty($user->id)) return null; + + $data = array(); + foreach($this->config->chat->user->canEditFields as $field) + { + if(!empty($user->$field)) $data[$field] = $user->$field; + } + if(!$data) return null; + + $data['clientLang'] = $this->app->getClientLang(); + $this->dao->update(TABLE_USER)->data($data)->where('id')->eq($user->id)->exec(); + return $this->getUserByUserID($user->id); + } + + public function getServer($backend = 'xxb') + { + $server = commonModel::getSysURL(); + if(!empty($this->config->xuanxuan->server)) $server = $this->config->xuanxuan->server; + + return $server; + } } diff --git a/xuanxuan/module/chat/ext/model/xuanxuan.php b/xuanxuan/module/chat/ext/model/xuanxuan.php index dd3683e8b5..2c8462b089 100644 --- a/xuanxuan/module/chat/ext/model/xuanxuan.php +++ b/xuanxuan/module/chat/ext/model/xuanxuan.php @@ -3,3 +3,13 @@ public function getExtensionList($userID) { return $this->loadExtension('xuanxuan')->getExtensionList($userID); } + +public function editUser($user = null) +{ + return $this->loadExtension('xuanxuan')->editUser($user); +} + +public function getServer($backend = 'xxb') +{ + return $this->loadExtension('xuanxuan')->getServer($backend); +}