Example #1
0
 public function onCommonGetNavs($type = '')
 {
     Cloud::loadFile('Service_SearchHelper');
     $navtype = null;
     switch ($type) {
         case 'footer':
             $navtype = 1;
             break;
         case 'space':
             $navtype = 2;
             break;
         case 'my':
             $navtype = 3;
             break;
         case 'header':
             $navtype = 0;
             break;
     }
     $navs = $subNavs = array();
     foreach (C::t('common_nav')->fetch_all_by_navtype($navtype) as $nav) {
         if (!$nav['parentid']) {
             $navs[$nav['id']] = Cloud_Service_SearchHelper::convertNav($nav);
         } else {
             $subNavs[$nav['id']] = $nav;
         }
     }
     foreach ($subNavs as $k => $v) {
         $navs[$v['parentid']]['navs'][$v['id']] = Cloud_Service_SearchHelper::convertNav($v);
     }
     return $navs;
 }
Example #2
0
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: OEM.php 33992 2013-09-17 01:01:52Z nemohou $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
Cloud::loadFile('Service_Client_Restful');
class Cloud_Service_Client_OEM extends Cloud_Service_Client_Restful
{
    protected static $_instance;
    public static function getInstance($debug = false)
    {
        if (!self::$_instance instanceof self) {
            self::$_instance = new self($debug);
        }
        return self::$_instance;
    }
    public function __construct($debug = false)
    {
        return parent::__construct($debug);
    }
    public function checkApp()
    {
        if (!$this->_sId) {
            return array();
        }
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: class_cloudregister.php 33799 2013-08-15 02:29:22Z nemohou $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
Cloud::loadFile('Service_Client_Cloud');
class Cloud_Register extends Cloud_Service_Client_Cloud
{
    public $appIdentifier;
    public $pluginid;
    protected $lang;
    public function __construct($appIdentifier, $pluginid, $startStep, $debug = false)
    {
        global $_G;
        parent::__construct($debug);
        $this->appIdentifier = $appIdentifier;
        $this->pluginid = $pluginid;
        $step = !empty($_GET['step']) ? authcode($_GET['step'], 'DECODE', $_G['config']['security']['authkey']) : $startStep;
        $method = 'step_' . $step;
        $this->lang = lang('cloud_register');
        if (!empty($_GET['skip'])) {
            return false;
        }
        if (method_exists($this, $method)) {
            return $this->{$method}();
Example #4
0
 private function _searchStatusCallback($appName, $status)
 {
     $available = 0;
     if ($status == 'normal') {
         $available = 1;
     }
     C::t('common_setting')->update('my_search_status', $available);
     if ($available) {
         Cloud::loadFile('Service_SearchHelper');
         Cloud_Service_SearchHelper::allowSearchForum();
     }
     $this->setPluginAvailable('cloudsearch', $available);
     return true;
 }
Example #5
0
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: Search.php 31868 2012-10-18 03:38:22Z zhouxiaobo $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
Cloud::loadFile('Service_SearchHelper');
class Cloud_Service_Server_Search extends Cloud_Service_Server_Restful
{
    protected static $_instance;
    public static function getInstance()
    {
        if (!self::$_instance instanceof self) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }
    public function onSearchGetUserGroupPermissions($userGroupIds)
    {
        if (!$userGroupIds) {
            return array();
        }
        $result = Cloud_Service_SearchHelper::getUserGroupPermissions($userGroupIds);
        return $result;
    }
    public function onSearchGetUpdatedPosts($num, $lastPostIds = array())
Example #6
0
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: Manyou.php 33053 2013-04-12 10:09:51Z zhengqingpeng $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
Cloud::loadFile('Service_Client_RestfulException');
class Cloud_Service_Client_Manyou
{
    private $_myurl = 'http://api.manyou.com/uchome.php';
    protected static $_instance;
    public static function getInstance()
    {
        if (!self::$_instance instanceof self) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }
    public function __construct()
    {
    }
    public function sync()
    {
        global $_G;
        $this->getResponse('siteRefresh');
        return true;
Example #7
0
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: ConnectOAuth.php 32196 2012-11-28 02:34:36Z liudongdong $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
Cloud::loadFile('Service_Connect');
Cloud::loadFile('Service_Client_OAuth');
class Cloud_Service_Client_ConnectOAuth extends Cloud_Service_Client_OAuth
{
    private $_requestTokenURL = 'http://openapi.qzone.qq.com/oauth/qzoneoauth_request_token';
    private $_oAuthAuthorizeURL = 'http://openapi.qzone.qq.com/oauth/qzoneoauth_authorize';
    private $_accessTokenURL = 'http://openapi.qzone.qq.com/oauth/qzoneoauth_access_token';
    private $_getUserInfoURL = 'http://openapi.qzone.qq.com/user/get_user_info';
    private $_addShareURL = 'http://openapi.qzone.qq.com/share/add_share';
    private $_addWeiBoURL = 'http://openapi.qzone.qq.com/wb/add_weibo';
    private $_addTURL = 'http://openapi.qzone.qq.com/t/add_t';
    private $_addPicTURL = 'http://openapi.qzone.qq.com/t/add_pic_t';
    private $_getReportListURL = 'http://openapi.qzone.qq.com/t/get_repost_list';
    // 用于请求失败或返回空时抛出的异常
    const RESPONSE_ERROR = 999;
    const RESPONSE_ERROR_MSG = 'request failed';
    /**
     * $_instance
     */
    protected static $_instance;
Example #8
0
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: Restful.php 29263 2012-03-31 05:45:08Z yexinhao $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
define('MY_FRIEND_NUM_LIMIT', 2000);
Cloud::loadFile('Service_Server_RestfulException');
Cloud::loadFile('Service_Server_Response');
Cloud::loadFile('Service_Server_ErrorResponse');
abstract class Cloud_Service_Server_Restful
{
    protected static $_instance;
    public static function getInstance()
    {
        if (!self::$_instance instanceof self) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }
    protected function _myAddslashes($string)
    {
        if (is_array($string)) {
            foreach ($string as $key => $val) {
                $string[$key] = $this->_myAddslashes($val);
            }
Example #9
0
<?php

/**
 *		[Discuz!] (C)2001-2099 Comsenz Inc.
 *		This is NOT a freeware, use is subject to license terms
 *
 *		$Id: Mobile.php 34063 2013-09-26 05:37:52Z nemohou $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
Cloud::loadFile('Service_Server_Restful');
class Cloud_Service_Server_Mobile extends Cloud_Service_Server_Restful
{
    protected static $_instance;
    public static function getInstance()
    {
        if (!self::$_instance instanceof self) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }
    public function onMobileLoginToken($deviceToken, $uid)
    {
        return C::t("#mobile#common_devicetoken")->loginToken($deviceToken, $uid);
    }
    public function onMobileLogoutToken($deviceToken, $uid)
    {
        return C::t("#mobile#common_devicetoken")->logoutToken($deviceToken);
    }
    public function onMobileClearToken($deviceToken)