Пример #1
0
 function ACloud_Ver_Customized_Base()
 {
     $daoObject = ACloud_Sys_Core_Common::getGlobal(ACLOUD_OBJECT_DAO);
     $daoObject->getDB();
     list($currentUid) = ACloud_Sys_Core_S::gp('current_uid');
     ACloud_Sys_Core_Common::setGlobal('customized_current_uid', $currentUid);
 }
Пример #2
0
 function execute()
 {
     $_extrasService = ACloud_Sys_Core_Common::loadSystemClass('extras', 'config.service');
     ACloud_Sys_Core_Common::setGlobal('g_ips', explode("|", ACLOUD_APPLY_IPS));
     ACloud_Sys_Core_Common::setGlobal('g_siteurl', ACLOUD_APPLY_SITEURL ? ACLOUD_APPLY_SITEURL : $_extrasService->getExtra('ac_apply_siteurl'));
     ACloud_Sys_Core_Common::setGlobal('g_charset', ACLOUD_APPLY_CHARSET ? ACLOUD_APPLY_CHARSET : $_extrasService->getExtra('ac_apply_charset'));
 }
 function replyMessage($messageId, $relationId, $uid, $content)
 {
     list($messageId, $relationId, $uid, $content) = array(intval($messageId), intval($relationId), intval($uid), trim($content));
     if ($messageId < 1 || $relationId < 1 || $uid < 1 || !$content) {
         return $this->buildResponse(MESSAGE_INVALID_PARAMS);
     }
     ACloud_Sys_Core_Common::setGlobal('customized_current_uid', intval($uid));
     $user = $this->getCurrentUser();
     if (!$user->isLogin()) {
         return $this->buildResponse(USER_NOT_LOGIN);
     }
     $user->initRight();
     $GLOBALS['winduid'] = $user->uid;
     $GLOBALS['windid'] = $user->username;
     $GLOBALS['groupid'] = $user->groupid;
     $GLOBALS['winddb'] = $user->info;
     $GLOBALS['_G'] = $user->_G;
     $messageService = $this->getMessageService();
     $message = $messageService->getMessage($messageId);
     $messageInfo = array('create_uid' => $user->uid, 'create_username' => $user->username, 'title' => $message['title'], 'content' => $content);
     $replyId = $messageService->sendReply($user->uid, $relationId, $messageId, $messageInfo);
     return $this->buildResponse(0, array('replyid' => $replyId));
 }
Пример #4
0
 function sendPost($tid, $uid, $title, $content)
 {
     global $winddb, $winduid, $windid, $groupid, $fid, $timestamp, $pwforum, $pwpost, $_G, $db_uploadfiletype, $uploadcredit, $uploadmoney, $manager, $isBM, $_time;
     $timestamp = time();
     $_time = array('hours' => get_date($timestamp, 'G'), 'day' => get_date($timestamp, 'j'), 'week' => get_date($timestamp, 'w'));
     list($uid, $tid, $title, $content) = array(intval($uid), intval($tid), trim($title), trim($content));
     if ($uid < 1 || $tid < 1 || !$content) {
         return $this->buildResponse(THREAD_INVALID_PARAMS);
     }
     ACloud_Sys_Core_Common::setGlobal('customized_current_uid', $uid);
     $user = $this->getCurrentUser();
     if (!$user->isLogin()) {
         return $this->buildResponse(USER_NOT_LOGIN);
     }
     if ($user->groupid == 6 || getstatus($user->info['userstatus'], PW_USERSTATUS_BANUSER)) {
         return $this->buildResponse(THREAD_USER_NOT_RIGHT);
     }
     $user->initRight();
     $winduid = $user->uid;
     $groupid = $user->groupid;
     $windid = $user->username;
     $winddb = $user->info;
     $_G = $user->_G;
     if ($_G['postlimit'] && $winddb['todaypost'] >= $_G['postlimit']) {
         return $this->buildResponse(POST_GP_LIMIT);
     }
     $tpcarray = $GLOBALS['db']->get_one("SELECT t.tid,t.fid,t.locked,t.ifcheck,t.author,t.authorid,t.postdate,t.lastpost,t.ifmail,t.special,t.subject,t.type,t.ifshield,t.anonymous,t.ptable,t.replies,t.tpcstatus FROM pw_threads t WHERE t.tid=" . pwEscape($tid));
     L::loadClass('forum', 'forum', false);
     $pwforum = new PwForum($tpcarray['fid']);
     if (!$pwforum->isForum()) {
         return $this->buildResponse(THREAD_FORUM_NOT_EXIST);
     }
     $fid = $tpcarray['fid'];
     $isBM = $pwforum->isBM($windid);
     $isGM = S::inArray($windid, $manager);
     if (!$isGM && $tpcarray['locked'] % 3 != 0 && !pwRights($isBM, 'replylock')) {
         return $this->buildResponse(THREAD_LOCKED);
     }
     L::loadClass('post', 'forum', false);
     require_once ACLOUD_VERSION_PATH . '/customized/ver.customized.bbscode.php';
     $pwpost = new PwPost($pwforum);
     $pwpost->errMode = true;
     $pwpost->forumcheck();
     $pwpost->postcheck();
     L::loadClass('replypost', 'forum', false);
     $replypost = new replyPost($pwpost);
     $replypost->setTpc($tpcarray);
     $replypost->check();
     $pw_posts = GetPtable($replypost->tpcArr['ptable']);
     $postdata = new replyPostData($pwpost);
     $postdata->setTitle($title);
     $postdata->setContent($content);
     $postdata->conentCheck();
     if ($pwpost->errMsg && ($msg = reset($pwpost->errMsg))) {
         return $this->buildResponse(THREAD_SYSTEM_ERROR, $msg);
     }
     require_once ACLOUD_VERSION_PATH . '/customized/ver.customized.attupload.php';
     if (PwUpload::getUploadNum()) {
         $_G['uploadtype'] && ($db_uploadfiletype = $_G['uploadtype']);
         $db_uploadfiletype = !empty($db_uploadfiletype) ? is_array($db_uploadfiletype) ? $db_uploadfiletype : unserialize($db_uploadfiletype) : array();
         $postdata->att = new AttUpload($user->uid);
         $return = $postdata->att->check();
         if ($return) {
             $msginfo = getLangInfo('msg', $return);
             return $this->errMessage(THREAD_USER_NOT_RIGHT, $msginfo);
         }
         list($windVersion) = explode(',', WIND_VERSION);
         if ($windVersion && $windVersion < '8.5') {
             $postdata->att->transfer();
             PwUpload::upload($postdata->att);
         }
     }
     $replypost->execute($postdata);
     $pid = $replypost->getNewId();
     return $this->buildResponse(0, array('pid' => $pid));
 }
 function apply($siteurl, $sitename = '', $bossname = '', $bossphone = '')
 {
     ACloud_Sys_Core_Common::setGlobal('g_siteurl', $siteurl);
     $extrasService = ACloud_Sys_Core_Common::loadSystemClass('extras', 'config.service');
     $extrasService->setExtra('ac_apply_siteurl', ACloud_Sys_Core_Common::parseDomainName($siteurl));
     $extrasService->setExtra('ac_apply_charset', ACloud_Sys_Core_Common::getGlobal('g_charset'));
     $extrasService->setExtra('ac_apply_lasttime', time());
     list($bool, $message) = $this->checkApply($siteurl);
     if (!$bool) {
         return array($bool, $message);
     }
     $service = ACloud_Sys_Core_Common::loadSystemClass('apply', 'open.service');
     list($bool, $message) = $service->submit($siteurl, $sitename, $bossname, $bossphone);
     if (!$bool) {
         return array($bool, $message);
     }
     list($bool, $message) = $service->verify(array('siteurl' => $siteurl));
     if (!$bool) {
         return array($bool, $message);
     }
     list($bool, $message) = $service->verified(array('siteurl' => $siteurl));
     if (!$bool) {
         return array($bool, $message);
     }
     return array(true, '');
 }
Пример #6
0
 function updateEmail($uid, $email)
 {
     $uid = intval($uid);
     if ($uid < 1) {
         return $this->buildResponse(USER_INVALID_PARAMS);
     }
     ACloud_Sys_Core_Common::setGlobal('customized_current_uid', intval($uid));
     $user = $this->getCurrentUser();
     if (!$user->isLogin()) {
         return $this->buildResponse(USER_NOT_LOGIN);
     }
     $email = trim($email) ? trim($email) : '';
     $query = $GLOBALS['db']->query("UPDATE pw_members SET email=" . S::sqlEscape($email) . " WHERE uid = " . S::sqlEscape($uid));
     return $this->buildResponse(0, array('uid' => $uid));
 }
 function postThread($uid, $fid, $subject, $content)
 {
     global $winddb, $winduid, $windid, $groupid, $_G, $timestamp, $pwforum, $pwpost, $uploadcredit, $uploadmoney, $db_uploadfiletype, $_time;
     $timestamp = time();
     $_time = array('hours' => get_date($timestamp, 'G'), 'day' => get_date($timestamp, 'j'), 'week' => get_date($timestamp, 'w'));
     list($uid, $fid, $subject, $content) = array(intval($uid), intval($fid), trim($subject), trim($content));
     if ($uid < 1 || $fid < 1 || !$subject || !$content) {
         return $this->buildResponse(THREAD_INVALID_PARAMS);
     }
     ACloud_Sys_Core_Common::setGlobal('customized_current_uid', $uid);
     $user = $this->getCurrentUser();
     if (!$user->isLogin()) {
         return $this->buildResponse(USER_NOT_LOGIN);
     }
     if ($user->groupid == 6 || getstatus($user->info['userstatus'], PW_USERSTATUS_BANUSER)) {
         return $this->buildResponse(THREAD_USER_NOT_RIGHT);
     }
     $user->initRight();
     $winduid = $user->uid;
     $groupid = $user->groupid;
     $windid = $user->username;
     $winddb = $user->info;
     $_G = $user->_G;
     if ($_G['postlimit'] && $winddb['todaypost'] >= $_G['postlimit']) {
         return $this->buildResponse(POST_GP_LIMIT);
     }
     L::loadClass('forum', 'forum', false);
     $pwforum = new PwForum($fid);
     if (!$pwforum->isForum()) {
         return $this->buildResponse(THREAD_FORUM_NOT_EXIST);
     }
     list($uploadcredit, $uploadmoney, , ) = explode("\t", $pwforum->forumset['uploadset']);
     L::loadClass('post', 'forum', false);
     require_once ACLOUD_VERSION_PATH . '/customized/ver.customized.bbscode.php';
     $pwpost = new PwPost($pwforum);
     $pwpost->errMode = true;
     $pwpost->forumcheck();
     $pwpost->postcheck();
     L::loadClass('topicpost', 'forum', false);
     $topicpost = new topicPost($pwpost);
     $topicpost->check();
     $postdata = new topicPostData($pwpost);
     $postdata->setWtype('', '', $pwforum->foruminfo['t_type'], $pwforum->foruminfo['topictype']);
     $postdata->setTitle($subject);
     $postdata->setContent($content);
     $postdata->setConvert(1, 1);
     $postdata->setTags('');
     $postdata->setDigest('');
     $postdata->setTopped('');
     $postdata->setIfsign(1, 0);
     if ($pwpost->errMsg && ($msg = reset($pwpost->errMsg))) {
         return $this->buildResponse(THREAD_SYSTEM_ERROR, $msg);
     }
     require_once ACLOUD_VERSION_PATH . '/customized/ver.customized.attupload.php';
     if (PwUpload::getUploadNum()) {
         $_G['uploadtype'] && ($db_uploadfiletype = $_G['uploadtype']);
         $db_uploadfiletype = !empty($db_uploadfiletype) ? is_array($db_uploadfiletype) ? $db_uploadfiletype : unserialize($db_uploadfiletype) : array();
         $postdata->att = new AttUpload($user->uid);
         $return = $postdata->att->check();
         if ($return) {
             $msginfo = getLangInfo('msg', $return);
             return $this->buildResponse(THREAD_USER_NOT_RIGHT);
         }
         list($windVersion) = explode(',', WIND_VERSION);
         if ($windVersion && $windVersion < '8.5') {
             PwUpload::upload($postdata->att);
             $postdata->att->transfer();
         }
     }
     $topicpost->execute($postdata);
     $tid = $topicpost->getNewId();
     return $this->buildResponse(0, array('tid' => $tid));
 }
Пример #8
0
<?php

set_time_limit(0);
define("ACLOUD_ADMINISTOR", true);
require_once R_P . 'aCloud/aCloud.php';
ACloud_Sys_Core_Common::setGlobal('g_siteurl', $GLOBALS['db_bbsurl']);
ACloud_Sys_Core_Common::setGlobal('g_sitename', $GLOBALS['db_bbsname']);
ACloud_Sys_Core_Common::setGlobal('g_charset', $GLOBALS['db_charset']);
$service = ACloud_Sys_Core_Common::loadSystemClass('administor', 'bench.service');
list($operate) = ACloud_Sys_Core_S::gp(array('operate'));
if (!$operate && $service->isOpen()) {
    $ac_url = $service->getLink();
} else {
    list($ac_step) = ACloud_Sys_Core_S::gp(array('step'));
    $ac_step = ($_ac_step = $service->getApplyStep($operate)) ? $_ac_step : ($ac_step ? $ac_step : 1);
    if ($ac_step == 7) {
        list($ac_siteurl) = ACloud_Sys_Core_S::gp(array('siteurl'));
        list($ac_bool, $ac_message) = $service->apply($ac_siteurl);
        $ac_step = $ac_bool ? 4 : 3;
        if ($ac_bool) {
            ACloud_Sys_Core_Common::refresh("{$basename}&step=1");
        }
    }
    if ($ac_step == 2) {
        list($ac_sitename, $ac_siteurl, $ac_charset, $ac_version) = $service->getSiteInfo();
        $ac_evninfo = $service->getEnvInfo();
        $ac_applyinfo = $service->getLastApplyInfo();
    }
    if ($ac_step == 4) {
        list($ac_lasttime, $ac_timeout) = $service->getApplyTimeOut();
    }
Пример #9
0
<?php

if (defined('ACLOUD_INDEX')) {
    error_reporting(E_ERROR | E_PARSE);
    !defined('ACLOUD_PATH') && exit('Forbidden');
    !defined('R_P') && define('R_P', ACloud_Sys_Core_Common::getDirName(ACLOUD_PATH));
    !defined('D_P') && define('D_P', R_P);
    !defined('P_W') && define('P_W', 'ACLOUD');
    define("COL", 1);
    require_once R_P . 'require/common.php';
    if (class_exists("pwCache") && method_exists("pwCache", "getData")) {
        include D_P . 'data/bbscache/baseconfig.php';
        pwCache::getData(D_P . 'data/bbscache/config.php');
    } else {
        include D_P . 'data/bbscache/config.php';
    }
    ACloud_Sys_Core_Common::setGlobal('attachpath', $db_attachurl != 'N' ? $db_attachurl : $db_bbsurl . '/' . $db_attachname);
    ACloud_Sys_Core_Common::setGlobal('imgpath', $db_http != 'N' ? $db_http : $db_bbsurl . '/' . $db_picpath);
    ACloud_Sys_Core_Common::setGlobal('imgdir', R_P . $db_picpath);
    ACloud_Sys_Core_Common::setGlobal('attachdir', R_P . $db_attachname);
    ACloud_Sys_Core_Common::setGlobal('tablepre', 'pw_');
}
if (!ACloud_Sys_Core_Common::getGlobal(ACLOUD_OBJECT_DAO)) {
    require sprintf(ACLOUD_PATH . '/version/%s/core/ver.core.dao.php', ACLOUD_VERSION);
    ACloud_Sys_Core_Common::setGlobal(ACLOUD_OBJECT_DAO, new ACloud_Ver_Core_Dao());
}
Пример #10
0
 function registerSystemParams()
 {
     list($format) = ACloud_Sys_Core_S::gp(array('format'));
     ACloud_Sys_Core_Common::setGlobal('acloud_api_output_format', $format);
     return true;
 }