Example #1
0
 public function deleteUser($uid)
 {
     Wind::import('SRV:user.srv.PwClearUserService');
     $userSer = new PwClearUserService($uid);
     $clear = $userSer->getClearTypes();
     $std = PwWindidStd::getInstance('user');
     $std->setMethod('deleteUser', $uid);
     $result = $userSer->run(array_keys($clear));
     if ($result instanceof PwError) {
         return false;
     }
     return true;
 }
Example #2
0
 public static function getInstance($api)
 {
     isset(self::$_instance) || (self::$_instance = new self($api));
     return self::$_instance;
 }
Example #3
0
File: Pw.php Project: healthguo/PHP
	public static function windid($api) {
		if (defined('WINDID_IS_NOTIFY')) {
			$cls[$api] = PwWindidStd::getInstance($api);
		} else {
			$cls[$api] = WindidApi::api($api);
		}
		return $cls[$api];
	}
Example #4
0
 public function synEditUser($uid)
 {
     if (!($unread = $this->_getWindid()->getUnRead($uid))) {
         return true;
     }
     Wind::import('SRV:user.dm.PwUserInfoDm');
     $dm = new PwUserInfoDm($uid);
     $dm->setMessageCount($unread);
     Wind::import('LIB:utility.PwWindidStd');
     $std = PwWindidStd::getInstance('user');
     $std->setMethod('editDmUser', 1);
     if (($result = $this->_getUserDs()->editUser($dm, PwUser::FETCH_DATA)) !== true) {
         return false;
     }
     $message = current($this->_getWindid()->getUnreadDialogsByUid($uid, 1));
     $last_message = $message['last_message'] ? unserialize($message['last_message']) : array();
     //发件人通知
     $params = array('from_uid' => $last_message['from_uid'], 'to_uid' => $last_message['to_uid'], 'content' => $last_message['content'], 'is_send' => 1);
     $this->_getNoticeService()->sendNotice($message['from_uid'], 'message', $message['to_uid'], $params, false);
     //收件人通知
     $params = array('from_uid' => $last_message['from_uid'], 'to_uid' => $last_message['to_uid'], 'content' => $last_message['content']);
     $this->_getNoticeService()->sendNotice($message['to_uid'], 'message', $message['from_uid'], $params, false);
     return true;
 }