Esempio n. 1
0
 public function addPlans($plans, $repid, $begindate, $enddate, $uid, $type, $exedetail = "")
 {
     foreach ($plans as $plan) {
         $remindDate = empty($plan["reminddate"]) ? 0 : strtotime($plan["reminddate"]);
         $record = array("repid" => $repid, "content" => StringUtil::filterCleanHtml($plan["content"]), "uid" => $uid, "flag" => isset($plan["process"]) && $plan["process"] == 10 ? 1 : 0, "planflag" => $type, "process" => isset($plan["process"]) ? $plan["process"] : 0, "exedetail" => StringUtil::filterCleanHtml($exedetail), "begindate" => $begindate, "enddate" => $enddate, "reminddate" => $remindDate);
         $rid = $this->add($record, true);
         $isInstallCalendar = ModuleUtil::getIsEnabled("calendar");
         if ($isInstallCalendar && $remindDate) {
             $calendar = array("subject" => $record["content"], "starttime" => $remindDate, "endtime" => $remindDate, "uid" => $uid, "upuid" => $uid, "lock" => 1, "category" => 4, "isalldayevent" => 1);
             $cid = Calendars::model()->add($calendar, true);
             CalendarRepRecord::model()->add(array("rid" => $rid, "cid" => $cid, "repid" => $repid));
         }
     }
 }
Esempio n. 2
0
 public function addRecord($plan, $diaryId, $planTime, $uid, $type)
 {
     foreach ($plan as $value) {
         $diaryRecord = array("diaryid" => $diaryId, "content" => htmlspecialchars($value["content"]), "planflag" => $type == "outside" ? 0 : 1, "schedule" => isset($value["schedule"]) ? $value["schedule"] : 0, "plantime" => $planTime, "flag" => isset($value["schedule"]) && $value["schedule"] == 10 ? 1 : 0, "uid" => $uid, "timeremind" => isset($value["timeremind"]) ? $value["timeremind"] : "");
         $rid = $this->add($diaryRecord, true);
         $isInstallCalendar = ModuleUtil::getIsEnabled("calendar");
         if ($isInstallCalendar && isset($value["timeremind"]) && !empty($value["timeremind"])) {
             $timeArr = explode(",", $value["timeremind"]);
             $st = $planTime + $timeArr[0] * 60 * 60;
             $et = $planTime + $timeArr[1] * 60 * 60;
             $calendar = array("subject" => $diaryRecord["content"], "starttime" => $st, "endtime" => $et, "uid" => $uid, "upuid" => $uid, "lock" => 1, "category" => 3, "isfromdiary" => 1);
             $cid = Calendars::model()->add($calendar, true);
             CalendarRecord::model()->add(array("rid" => $rid, "cid" => $cid, "did" => $diaryId));
         }
     }
 }
Esempio n. 3
0
 public function actionUserCard()
 {
     $uid = EnvUtil::getRequest("uid");
     $user = User::model()->fetchByUid($uid);
     $onlineStatus = UserUtil::getOnlineStatus($uid);
     $styleMap = array(-1 => "o-pm-offline", 1 => "o-pm-online");
     if (empty($user)) {
         $this->error(Ibos::lang("Request tainting", "error"));
     } else {
         $weiboExists = ModuleUtil::getIsEnabled("weibo");
         $data = array("user" => $user, "status" => $styleMap[$onlineStatus], "lang" => Ibos::getLangSources(), "weibo" => $weiboExists);
         if ($weiboExists) {
             $data["userData"] = UserData::model()->getUserData($user["uid"]);
             $data["states"] = Follow::model()->getFollowState(Ibos::app()->user->uid, $user["uid"]);
         }
         $content = $this->renderPartial("userCard", $data, true);
         echo $content;
         exit;
     }
 }
Esempio n. 4
0
 public static function getJsConstantUids($uid)
 {
     $inEnabledContact = ModuleUtil::getIsEnabled("contact");
     $cUids = $inEnabledContact ? Contact::model()->fetchAllConstantByUid($uid) : array();
     $cUidStr = empty($cUids) ? "" : StringUtil::wrapId($cUids);
     return empty($cUidStr) ? "" : CJSON::encode(explode(",", $cUidStr));
 }
Esempio n. 5
0
 public function put($uid, $module = "weibo", $type = "", $data = array(), $rowid = 0, $table = "feed", $extUid = null, $lessUids = null, $isAtMe = true, $isRepost = 0)
 {
     if (!$uid || $type == "") {
         $this->addError("putFeed", Ibos::lang("Operation failure", "message"));
         return false;
     }
     if (!in_array($type, array("post", "repost", "postimage"))) {
         $type = "post";
     }
     if (!ModuleUtil::getIsEnabled($module)) {
         $module = "weibo";
         $type = "post";
         $table = "feed";
     }
     $table = strtolower($table);
     $data["uid"] = $uid;
     $data["module"] = $module;
     $data["type"] = $type;
     $data["rowid"] = $rowid;
     $data["table"] = $table;
     $data["ctime"] = time();
     $data["from"] = isset($data["from"]) ? intval($data["from"]) : EnvUtil::getVisitorClient();
     $data["isdel"] = $data["commentcount"] = $data["diggcount"] = $data["repostcount"] = 0;
     $data["isrepost"] = $isRepost;
     $content = $this->formatFeedContent($data["body"]);
     $data["body"] = $content["body"];
     $data["content"] = $content["content"];
     $data["body"] .= isset($data["source_url"]) ? $data["source_url"] : "";
     $data["content"] .= isset($data["source_url"]) ? $data["source_url"] : "";
     $feedId = $this->add($data, true);
     if (!$feedId) {
         return false;
     }
     $data["content"] = str_replace(chr(31), "", $data["content"]);
     $data["body"] = str_replace(chr(31), "", $data["body"]);
     $feedData = array("feedid" => $feedId, "feeddata" => serialize($data), "clientip" => EnvUtil::getClientIp(), "feedcontent" => $data["body"]);
     $feedDataId = FeedData::model()->add($feedData, true);
     if ($feedId && $feedDataId) {
         if ($data["isrepost"] == 1) {
             if ($isAtMe) {
                 $content = $data["content"];
             } else {
                 $content = $data["body"];
             }
             $extUid[] = isset($data["sourceInfo"]["transpond_data"]) ? $data["sourceInfo"]["transpond_data"]["uid"] : null;
             if ($isAtMe && !empty($data["curid"])) {
                 $appRowData = $this->get($data["curid"]);
                 $extUid[] = $appRowData["uid"];
             }
         } else {
             $content = $data["content"];
             Atme::model()->updateRecentAt($content);
         }
         Atme::model()->addAtme("weibo", "feed", $content, $feedId, $extUid, $lessUids);
         $data["clientip"] = EnvUtil::getClientIp();
         $data["feedid"] = $feedId;
         $data["feeddata"] = serialize($data);
         $return = $this->setFeedCache($data);
         $return["user_info"] = User::model()->fetchByUid($uid);
         $return["feedid"] = $feedId;
         $return["rowid"] = $data["rowid"];
         if ($module == "weibo") {
             UserData::model()->updateKey("feed_count", 1);
             UserData::model()->updateKey("weibo_count", 1);
         }
         return $return;
     } else {
         $this->addError("putFeed", Ibos::lang("Operation failure", "message"));
         return false;
     }
 }
Esempio n. 6
0
function convertCal()
{
    if (ModuleUtil::getIsEnabled('calendar')) {
        global $ibos2Config, $editPre;
        $sql = "REPLACE INTO \r\n{$ibos2Config['dbPre']}calendars(\r\n`calendarid`,\r\n`subject`,\r\n`location`,\r\n`mastertime`,\r\n`masterid`,\r\n`description`,\r\n`calendartype`,\r\n`starttime`,\r\n`endtime`,\r\n`isalldayevent`,\r\n`hasattachment`,\r\n`category`,\r\n`instancetype`,\r\n`recurringtype`,\r\n`recurringtime`,\r\n`status`,\r\n`recurringbegin`,\r\n`recurringend`,\r\n`attendees`,\r\n`attendeenames`,\r\n`otherattendee`,\r\n`upuid`,\r\n`upname`,\r\n`uptime`,\r\n`recurringrule`,\r\n`uid`\r\n) SELECT \r\n`Id`,\r\n`Subject`,\r\n`Location`,\r\n`MasterTime`,\r\n`MasterId`,\r\n`Description`,\r\n`CalendarType`,\r\n`StartTime`,\r\n`EndTime`,\r\n`IsAllDayEvent`,\r\n`HasAttachment`,\r\n`Category`,\r\n`InstanceType`,\r\n`RecurringType`,\r\n`RecurringTime`,\r\n`Status`,\r\n`RecurringBegin`,\r\n`RecurringEnd`,\r\n`Attendees`,\r\n`AttendeeNames`,\r\n`OtherAttendee`,\r\n`UPAccount`,\r\n`UPName`,\r\n`UPTime`,\r\n`RecurringRule`,\r\n`uid`\r\nFROM {$editPre}calendars";
        $do = mysql_query($sql);
        showlog("日程表转换完成");
    }
}
Esempio n. 7
0
				<li>
					<a href="<?php 
    echo $this->createUrl('attention/index');
    ?>
">
						<i class="o-da-shared"></i>
						<?php 
    echo Ibos::lang('Attention diary');
    ?>
					</a>
				</li>
			<?php 
}
?>
			<?php 
if (ModuleUtil::getIsEnabled('statistics') && isset($statModule['diary'])) {
    ?>
				<?php 
    echo $this->widget(StatCommonUtil::getWidgetName('diary', StatConst::SIDEBAR_WIDGET), array('hasSub' => $this->checkIsHasSub()), true);
    ?>
			<?php 
}
?>
        </ul>
    </div>
</div>
<script type="text/ibos-template" id="sidebar_template">
    <td data-action="toOneDay" data-id="<%=diaryid%>" class="<%=className%>"><%=day%></td>
</script>
<script>
	Ibos.app.setPageParam({
Esempio n. 8
0
<?php

defined("IN_MODULE_ACTION") || exit("Access Denied");
$creditExists = CreditRule::model()->countByAttributes(array("action" => "adddiary"));
if (!$creditExists) {
    $data = array("rulename" => "发表工作日志", "action" => "adddiary", "cycletype" => "3", "rewardnum" => "2", "extcredits1" => "0", "extcredits2" => "2", "extcredits3" => "1");
    CreditRule::model()->add($data);
}
$isInstallCalendar = ModuleUtil::getIsEnabled("calendar");
if ($isInstallCalendar) {
    $sql = "CREATE TABLE IF NOT EXISTS {{calendar_record}} (\n        `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n        `cid` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '日程的id',\n        `rid` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '来自日志的计划id',\n        `did` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '日志的id',\n        PRIMARY KEY (`id`),\n        KEY `cid` (`cid`) USING BTREE,\n        KEY `rid` (`rid`) USING BTREE,\n        KEY `did` (`did`) USING BTREE\n      ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;";
    Yii::app()->db->createCommand($sql)->query();
}
Esempio n. 9
0
 public function getIsWeiboEnabled()
 {
     return ModuleUtil::getIsEnabled("weibo");
 }
Esempio n. 10
0
    ?>
</td>
									<td>
										<?php 
    if ($module['iscore'] == 1) {
        echo $lang['System built in'];
        ?>
										<?php 
    } elseif ($module['iscore'] == 2) {
        echo $lang['Core depend'];
        ?>
										<?php 
    } else {
        ?>
											<input type="checkbox" <?php 
        if ($module['disabled'] == 0 && ModuleUtil::getIsEnabled($module['module'])) {
            ?>
checked<?php 
        }
        ?>
 value="<?php 
        echo $module['module'];
        ?>
" data-toggle="switch" class="visi-hidden">
										<?php 
    }
    ?>
									</td>
									<td>
										<?php 
    if (!empty($module['managerUrl'])) {
Esempio n. 11
0
echo $user["realname"];
?>
" />
	<div class="uic-lv">
		<i class="lv lv<?php 
echo $user["level"];
?>
"></i>
		<strong><?php 
echo $user["group_title"];
?>
</strong>
	</div>
	<div class="uic-operate">
		<?php 
if (ModuleUtil::getIsEnabled("email")) {
    ?>
			<a target="_blank" href="<?php 
    echo Ibos::app()->createUrl("email/content/add", array("toid" => $user["uid"]));
    ?>
" title="<?php 
    echo $lang["Send email"];
    ?>
" class="co-temail"></a>
		<?php 
}
?>

		<?php 
if (Ibos::app()->user->uid !== $user["uid"]) {
    ?>
Esempio n. 12
0
 public function actionIndex()
 {
     $mod = EnvUtil::getRequest("mod");
     $modList = array("email", "diary");
     if (!in_array($mod, $modList)) {
         foreach ($modList as $module) {
             if (ModuleUtil::getIsEnabled($module)) {
                 $mod = $module;
                 break;
             }
         }
     }
     if (!ModuleUtil::getIsEnabled($mod)) {
         $this->error(Ibos::lang("Module not installed"));
     }
     $operation = EnvUtil::getRequest("op");
     if (!in_array($operation, array("manage", "move", "movechoose", "droptable", "addtable"))) {
         $operation = "manage";
     }
     $data = array();
     if ($mod == "email") {
         $tableDriver = array("tableId" => "emailtableids", "tableInfo" => "emailtable_info", "mainTable" => "Email", "bodyTable" => "EmailBody", "bodyIdField" => "bodyid");
     } else {
         $tableDriver = array("tableId" => "diarytableids", "tableInfo" => "diarytable_info", "mainTable" => "Diary", "bodyTable" => "DiaryRecord", "bodyIdField" => "diaryid");
     }
     $setting = Setting::model()->fetchSettingValueByKeys($tableDriver["tableId"] . "," . $tableDriver["tableInfo"], true);
     $tableIds = $setting[$tableDriver["tableId"]] ? $setting[$tableDriver["tableId"]] : array();
     $tableInfo = $setting[$tableDriver["tableInfo"]] ? $setting[$tableDriver["tableInfo"]] : array();
     $formSubmit = EnvUtil::submitCheck("archiveSubmit");
     if ($formSubmit) {
         if ($operation == "manage") {
             $info = array();
             $_POST["memo"] = !empty($_POST["memo"]) ? $_POST["memo"] : array();
             $_POST["displayname"] = !empty($_POST["displayname"]) ? $_POST["displayname"] : array();
             foreach (array_keys($_POST["memo"]) as $tableId) {
                 $info[$tableId]["memo"] = $_POST["memo"][$tableId];
             }
             foreach (array_keys($_POST["displayname"]) as $tableId) {
                 $info[$tableId]["displayname"] = $_POST["displayname"][$tableId];
             }
             Setting::model()->updateSettingValueByKey($tableDriver["tableInfo"], $info);
             CacheUtil::save($tableDriver["tableInfo"], $info);
             ArchiveSplitUtil::updateTableIds($tableDriver);
             CacheUtil::update(array("setting"));
             $this->success(Ibos::lang("Archivessplit manage update succeed"), $this->createUrl("split/index", array("op" => "manage", "mod" => $mod)));
         } elseif ($operation == "movechoose") {
             $conditions = array("sourcetableid" => EnvUtil::getRequest("sourcetableid"), "timerange" => intval(EnvUtil::getRequest("timerange")));
             $showDetail = intval($_POST["detail"]);
             $count = ArchiveSplitUtil::search($conditions, $tableDriver, true);
             $data["count"] = $count;
             $data["sourceTableId"] = $conditions["sourcetableid"];
             $data["tableInfo"] = $tableInfo;
             if ($showDetail) {
                 $list = ArchiveSplitUtil::search($conditions, $tableDriver);
                 !empty($list) && ($data["list"] = $list);
                 $data["detail"] = 1;
             } else {
                 $data["readyToMove"] = $count;
                 $data["detail"] = 0;
             }
             $data["conditions"] = serialize($conditions);
             $data = array_merge($data, ArchiveSplitUtil::getTableStatus($tableIds, $tableDriver));
             $this->render($mod . "MoveChoose", $data);
         } elseif ($operation == "moving") {
             $tableId = intval(EnvUtil::getRequest("tableid"));
             $step = intval(EnvUtil::getRequest("step"));
             $sourceTableId = intval(EnvUtil::getRequest("sourcetableid"));
             $detail = intval(EnvUtil::getRequest("detail"));
             if (!$tableId) {
                 $this->error(Ibos::lang("Archivessplit no target table"));
             }
             $continue = false;
             $readyToMove = intval(EnvUtil::getRequest("readytomve"));
             $bodyIdArr = !empty($_POST["bodyidarray"]) ? $_POST["bodyidarray"] : array();
             if (empty($bodyIdArr) && !$detail && !empty($_POST["conditions"])) {
                 $conditions = unserialize($_POST["conditions"]);
                 $maxMove = intval($_POST["pertime"]) ? intval($_POST["pertime"]) : self::DEFAULT_ARCHIVE_MOVE;
                 $list = ArchiveSplitUtil::search($conditions, $tableDriver, false, $maxMove);
                 $bodyIdArr = ConvertUtil::getSubByKey($list, $tableDriver["bodyIdField"]);
             } else {
                 $readyToMove = count($bodyIdArr);
             }
             if (!empty($bodyIdArr)) {
                 $continue = true;
             }
             if ($tableId == $sourceTableId) {
                 $this->error(Ibos::lang("Archivessplit source cannot be the target"), $this->createUrl("split/index", array("op" => "move", "mod" => $mod)));
             }
             if ($continue) {
                 $cronArchiveSetting = Setting::model()->fetchSettingValueByKeys("cronarchive", true);
                 $tableTarget = intval($tableId);
                 $tableSource = $_POST["sourcetableid"] ? $_POST["sourcetableid"] : 0;
                 $tableDriver["mainTable"]::model()->moveByBodyId($bodyIdArr, $tableSource, $tableTarget);
                 $tableDriver["bodyTable"]::model()->moveByBodyid($bodyIdArr, $tableSource, $tableTarget);
                 if (!$step) {
                     if ($_POST["setcron"] == "1") {
                         $cronArchiveSetting[$mod] = array("sourcetableid" => $tableSource, "targettableid" => $tableTarget, "conditions" => unserialize($_POST["conditions"]));
                     } else {
                         unset($cronArchiveSetting[$mod]);
                     }
                     Setting::model()->updateSettingValueByKey("cronarchive", $cronArchiveSetting);
                 }
                 $completed = intval(EnvUtil::getRequest("completed")) + count($bodyIdArr);
                 $nextStep = $step + 1;
             }
             $param = array("op" => "moving", "tableid" => $tableId, "completed" => $completed, "sourcetableid" => $sourceTableId, "readytomove" => $readyToMove, "step" => $nextStep, "detail" => $detail, "mod" => $mod);
             $data["message"] = Ibos::lang(ucfirst($mod) . " moving", "", array("{count}" => $completed, "{total}" => $readyToMove, "{pertime}" => $_POST["pertime"], "{conditions}" => $_POST["conditions"]));
             $data["url"] = $this->createUrl("split/index", $param);
             $this->render("moving", $data);
         }
     } elseif ($operation == "droptable") {
         $tableId = intval(EnvUtil::getRequest("tableid"));
         $statusInfo = $tableDriver["mainTable"]::model()->getTableStatus($tableId);
         if (!$tableId || !$statusInfo) {
             $this->error(Ibos::lang("Archivessplit table no exists"));
         }
         if (0 < $statusInfo["Rows"]) {
             $this->error(Ibos::lang("Archivessplit drop table no empty error"));
         }
         $tableDriver["mainTable"]::model()->dropTable($tableId);
         $tableDriver["bodyTable"]::model()->dropTable($tableId);
         unset($tableInfo[$tableId]);
         ArchiveSplitUtil::updateTableIds($tableDriver);
         Setting::model()->updateSettingValueByKey($tableDriver["tableInfo"], $tableInfo);
         CacheUtil::save($tableDriver["tableInfo"], $tableInfo);
         CacheUtil::update(array("setting"));
         $this->success(Ibos::lang("Archivessplit drop table succeed"), $this->createUrl("split/index", array("op" => "manage", "mod" => $mod)));
     } elseif ($operation == "manage") {
         $data["tableInfo"] = $tableInfo;
         $data = array_merge($data, ArchiveSplitUtil::getTableStatus($tableIds, $tableDriver));
         $this->render($mod . "Manage", $data);
     } elseif ($operation == "addtable") {
         if (empty($tableIds)) {
             $maxTableId = 0;
         } else {
             $maxTableId = max($tableIds);
         }
         $tableDriver["mainTable"]::model()->createTable($maxTableId + 1);
         $tableDriver["bodyTable"]::model()->createTable($maxTableId + 1);
         ArchiveSplitUtil::updateTableIds($tableDriver);
         CacheUtil::update(array("setting"));
         $this->success(Ibos::lang("Archivessplit table create succeed"), $this->createUrl("split/index", array("op" => "manage", "mod" => $mod)));
     } elseif ($operation == "move") {
         if (Ibos::app()->setting->get("setting/appclosed") !== "1") {
             $this->error(Ibos::lang("Archivessplit must be closed"), $this->createUrl("split/index", array("op" => "manage", "mod" => $mod)));
         }
         $tableSelect = array();
         foreach ($tableIds as $tableId) {
             $tableSelect[$tableId] = $tableDriver["mainTable"]::model()->getTableName($tableId) . " & " . $tableDriver["bodyTable"]::model()->getTableName($tableId);
         }
         $data["tableSelect"] = $tableSelect;
         $this->render($mod . "Move", $data);
     }
 }
Esempio n. 13
0
 private function modifyProfile()
 {
     if (Ibos::app()->request->isAjaxRequest) {
         $uid = Ibos::app()->user->uid;
         if (!empty($_POST["src"])) {
             $this->cropImg();
         }
         $profileField = array("birthday");
         $userField = array("mobile", "email");
         $model = array();
         foreach ($_POST as $key => $value) {
             if (in_array($key, $profileField) && !empty($value)) {
                 if ($key == "birthday") {
                     $value = strtotime($value);
                     $model["UserProfile"][$key] = StringUtil::filterCleanHtml($value);
                 }
             } elseif (in_array($key, $userField)) {
                 $model["User"][$key] = StringUtil::filterCleanHtml($value);
             }
         }
         foreach ($model as $modelObject => $value) {
             $modelObject::model()->modify($uid, $value);
         }
         User::model()->modify($uid, array("newcomer" => 0));
         $isInstallWeibo = ModuleUtil::getIsEnabled("weibo");
         $this->ajaxReturn(array("isSuccess" => true, "isInstallWeibo" => !!$isInstallWeibo));
     }
 }
Esempio n. 14
0
 protected function getIsInstallCalendar()
 {
     return ModuleUtil::getIsEnabled("calendar");
 }
Esempio n. 15
0
<?php

$isInstallDiary = ModuleUtil::getIsEnabled("diary");
if ($isInstallDiary) {
    $sql = "CREATE TABLE IF NOT EXISTS {{calendar_record}} (\n            `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n            `cid` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '日程的id',\n            `rid` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '来自日志的计划id',\n            `did` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '日志的id',\n            PRIMARY KEY (`id`),\r\n\t\t\tKEY `cid` (`cid`) USING BTREE,\n            KEY `rid` (`rid`) USING BTREE,\n            KEY `did` (`did`) USING BTREE\n          ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;";
    Yii::app()->db->createCommand($sql)->query();
}
$isInstallReport = ModuleUtil::getIsEnabled("report");
if ($isInstallReport) {
    $sql1 = "CREATE TABLE IF NOT EXISTS {{calendar_rep_record}} (\n            `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n            `cid` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '日程的id',\n            `rid` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '来自日志的计划id',\n            `repid` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '总结的id',\n            PRIMARY KEY (`id`),\n            KEY `cid` (`cid`) USING BTREE,\n            KEY `rid` (`rid`) USING BTREE,\n            KEY `repid` (`repid`) USING BTREE\n          ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;";
    Yii::app()->db->createCommand($sql1)->query();
}
Esempio n. 16
0
<?php

$articleComments = Comment::model()->fetchAllByAttributes(array("module" => "article"));
$cidArr = ConvertUtil::getSubByKey($articleComments, "cid");
if (!empty($articleComments)) {
    $cidStr = implode(",", $cidArr);
    Comment::model()->deleteAll("rowid IN({$cidStr})");
    Comment::model()->deleteAllByAttributes(array("module" => "article"));
}
$isInstallVote = ModuleUtil::getIsEnabled("vote");
if ($isInstallVote) {
    $articleVotes = Vote::model()->fetchAllByAttributes(array("relatedmodule" => "article"));
    $voteidArr = ConvertUtil::getSubByKey($articleVotes, "voteid");
    $voteidStr = implode(",", $voteidArr);
    $articleVoteItems = VoteItem::model()->fetchAll("FIND_IN_SET(voteid, '{$voteidStr}')");
    $itemidArr = ConvertUtil::getSubByKey($articleVoteItems, "itemid");
    $itemidStr = implode(",", $itemidArr);
    VoteItemCount::model()->deleteAll("FIND_IN_SET(itemid, '{$itemidStr}')");
    VoteItem::model()->deleteAll("FIND_IN_SET(itemid, '{$itemidStr}')");
    Vote::model()->deleteAllByAttributes(array("relatedmodule" => "article"));
}
Esempio n. 17
0
 protected function getEmailInstalled()
 {
     $isInstallEmail = ModuleUtil::getIsEnabled("email");
     return $isInstallEmail;
 }
Esempio n. 18
0
">
                    <i class="o-portal-office"></i>
                    办公门户
                </a>
            </li>
            <li>
                <a href="<?php 
echo Ibos::app()->urlManager->createUrl("weibo/home/index");
?>
">
                    <i class="o-portal-personal"></i>
                    个人门户
                </a>
            </li>
			<?php 
if (ModuleUtil::getIsEnabled("app")) {
    ?>
            <li class="active">
                <a href="<?php 
    echo Ibos::app()->urlManager->createUrl("app/default/index");
    ?>
">
                    <i class="o-portal-app"></i>
                    应用门户
                </a>
            </li>
			<?php 
}
?>
        </ul>
    </div>
Esempio n. 19
0
 public function actionDel()
 {
     if (Ibos::app()->request->isAjaxRequest) {
         $diaryids = EnvUtil::getRequest("diaryids");
         $uid = Ibos::app()->user->uid;
         if (empty($diaryids)) {
             $this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("Select at least one")));
         }
         $pk = "";
         if (strpos($diaryids, ",")) {
             $diaryids = trim($diaryids, ",");
             $pk = explode(",", $diaryids);
         } else {
             $pk = array($diaryids);
         }
         $diarys = Diary::model()->fetchAllByPk($pk);
         foreach ($diarys as $diary) {
             if (!ICDiary::checkReadScope($uid, $diary)) {
                 $this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("You do not have permission to delete the log")));
             }
         }
         $aids = Diary::model()->fetchAllAidByPks($pk);
         if ($aids) {
             AttachUtil::delAttach($aids);
         }
         $isInstallCalendar = ModuleUtil::getIsEnabled("calendar");
         if ($isInstallCalendar) {
             Calendars::model()->deleteALL("`calendarid` IN(select `cid` from {{calendar_record}} where FIND_IN_SET(`did`, '{$diaryids}')) ");
             CalendarRecord::model()->deleteAll("did IN ({$diaryids})");
         }
         Diary::model()->deleteByPk($pk);
         DiaryRecord::model()->deleteAll("diaryid IN ({$diaryids})");
         DiaryStats::model()->deleteAll("diaryid IN ({$diaryids})");
         $this->ajaxReturn(array("isSuccess" => true, "msg" => Ibos::lang("Del succeed", "message")));
     }
 }
Esempio n. 20
0
 public function init()
 {
     if (!ModuleUtil::getIsEnabled("statistics")) {
         $this->error(Ibos::t("Module \"{module}\" is illegal.", "error", array("{module}" => Ibos::lang("Statistics"))), $this->createUrl("default/index"));
     }
 }
Esempio n. 21
0
 public function actionLogin()
 {
     if (!Ibos::app()->user->isGuest) {
         $return = array("login" => true, "formhash" => FORMHASH, "uid" => Yii::app()->user->uid, "user" => user::model()->fetchByUid(Ibos::app()->user->uid), "APPID" => Ibos::app()->setting->get("setting/iboscloud/appid"));
         if (EnvUtil::getRequest("issetuser") != "true") {
             $userData = UserUtil::getUserByPy();
             $return["userData"] = $userData;
         }
         if (ModuleUtil::getIsEnabled("weibo")) {
             $udata = UserData::model()->getUserData();
         }
         $return["user"]["following_count"] = isset($udata["following_count"]) ? $udata["following_count"] : 0;
         $return["user"]["follower_count"] = isset($udata["follower_count"]) ? $udata["follower_count"] : 0;
         $return["user"]["weibo_count"] = isset($udata["weibo_count"]) ? $udata["weibo_count"] : 0;
         $this->ajaxReturn($return, "JSONP");
     }
     $account = Ibos::app()->setting->get("setting/account");
     $userName = EnvUtil::getRequest("username");
     $passWord = EnvUtil::getRequest("password");
     $gps = EnvUtil::getRequest("gps");
     $address = EnvUtil::getRequest("address");
     $ip = Ibos::app()->setting->get("clientip");
     $cookieTime = 0;
     if (!$passWord || $passWord != addslashes($passWord)) {
         $this->ajaxReturn(array("login" => false, "msg" => Ibos::lang("Passwd illegal", "user.default")), "JSONP");
     }
     $identity = new ICUserIdentity($userName, $passWord);
     $result = $identity->authenticate(false);
     if (0 < $result) {
         $user = Ibos::app()->user;
         if ($account["allowshare"] != 1) {
             $user->setStateKeyPrefix(Ibos::app()->setting->get("sid"));
         }
         MainUtil::setCookie("autologin", 1, $cookieTime);
         $user->login($identity, $cookieTime);
         if ($user->uid != 1) {
             MainUtil::checkLicenseLimit(true);
         }
         $urlForward = EnvUtil::referer();
         $log = array("terminal" => "app", "password" => StringUtil::passwordMask($passWord), "ip" => $ip, "user" => $userName, "loginType" => "username", "address" => $address, "gps" => $gps);
         Log::write($log, "login", sprintf("module.user.%d", Ibos::app()->user->uid));
         $return = array("login" => true, "formhash" => EnvUtil::formHash(), "uid" => Ibos::app()->user->uid, "user" => user::model()->fetchByUid(Ibos::app()->user->uid), "APPID" => Ibos::app()->setting->get("setting/iboscloud/appid"));
         if (ModuleUtil::getIsEnabled("weibo")) {
             $udata = UserData::model()->getUserData();
         }
         $return["user"]["following_count"] = isset($udata["following_count"]) ? $udata["following_count"] : 0;
         $return["user"]["follower_count"] = isset($udata["follower_count"]) ? $udata["follower_count"] : 0;
         $return["user"]["weibo_count"] = isset($udata["weibo_count"]) ? $udata["weibo_count"] : 0;
         if (EnvUtil::getRequest("issetuser") != "true") {
             $userData = UserUtil::getUserByPy();
             $return["userData"] = $userData;
         }
         $this->ajaxReturn($return, "JSONP");
     } elseif ($result === 0) {
         $this->ajaxReturn(array("login" => false, "msg" => Ibos::lang("User not fount", "user.default", array("{username}" => $userName))), "JSONP");
     } elseif ($result === -1) {
         $this->ajaxReturn(array("login" => false, "msg" => Ibos::lang("User lock", "user.default", array("{username}" => $userName))), "JSONP");
     } elseif ($result === -2) {
         $this->ajaxReturn(array("login" => false, "msg" => Ibos::lang("User disabled", "", array("{username}" => $userName))), "JSONP");
     } elseif ($result === -3) {
         $log = array("user" => $userName, "password" => StringUtil::passwordMask($passWord), "ip" => $ip);
         Log::write($log, "illegal", "module.user.login");
         $this->ajaxReturn(array("login" => false, "msg" => Ibos::lang("User name or password is not correct", "user.default")), "JSONP");
     }
 }
Esempio n. 22
0
 public function actionShow()
 {
     $repid = EnvUtil::getRequest("repid");
     $uid = Ibos::app()->user->uid;
     if (empty($repid)) {
         $this->error(Ibos::lang("Parameters error", "error"), $this->createUrl("default/index"));
     }
     $report = Report::model()->fetchByPk($repid);
     if (empty($report)) {
         $this->error(Ibos::lang("File does not exists", "error"), $this->createUrl("default/index"));
     }
     if ($report["uid"] != $uid) {
         $this->error(Ibos::lang("Request tainting", "error"), $this->createUrl("default/index"));
     }
     $record = ReportRecord::model()->fetchAllRecordByRep($report);
     $attachs = $readers = array();
     if (!empty($report["attachmentid"])) {
         $attachments = AttachUtil::getAttach($report["attachmentid"], true, true, false, false, true);
         $attachs = array_values($attachments);
     }
     if (!empty($report["readeruid"])) {
         $readerArr = explode(",", $report["readeruid"]);
         $readers = User::model()->fetchAllByPk($readerArr);
     }
     $stampUrl = "";
     if (!empty($report["stamp"])) {
         $stampUrl = Stamp::model()->fetchStampById($report["stamp"]);
     }
     $params = array("report" => $report, "preAndNextRep" => Report::model()->fetchPreAndNextRep($report), "orgPlanList" => $record["orgPlanList"], "outSidePlanList" => $record["outSidePlanList"], "nextPlanList" => $record["nextPlanList"], "attachs" => $attachs, "readers" => $readers, "stampUrl" => $stampUrl, "realname" => User::model()->fetchRealnameByUid($report["uid"]), "departmentName" => Department::model()->fetchDeptNameByUid($report["uid"]), "isInstallCalendar" => ModuleUtil::getIsEnabled("calendar"));
     if (!empty($params["nextPlanList"])) {
         $reportType = ReportType::model()->fetchByPk($report["typeid"]);
         $firstPlan = $params["nextPlanList"][0];
         $params["nextSubject"] = ICReport::handleShowSubject($reportType, $firstPlan["begindate"], $firstPlan["enddate"], 1);
     }
     $this->setPageTitle(Ibos::lang("Show report"));
     $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Personal Office")), array("name" => Ibos::lang("Work report"), "url" => $this->createUrl("default/index")), array("name" => Ibos::lang("Show report"))));
     $this->render("show", $params);
 }
Esempio n. 23
0
									<?php 
        }
        ?>
	                            </ul>
	                        </li>
						<?php 
    }
    ?>
						<?php 
}
?>
                    </ul>
                </div>
            </li>
			<?php 
if (ModuleUtil::getIsEnabled("statistics") && isset($statModule["report"])) {
    ?>
				<?php 
    echo $this->widget(StatCommonUtil::getWidgetName("report", StatConst::SIDEBAR_WIDGET), array("hasSub" => $this->checkIsHasSub()), true);
    ?>
			<?php 
}
?>
        </ul>
    </div>
</div>
<script>
	Ibos.app.setPageParam({
		'currentSubUid': "<?php 
echo EnvUtil::getRequest("uid") ? EnvUtil::getRequest("uid") : 0;
?>
Esempio n. 24
0
">
                    <i class="o-portal-office"></i>
                    办公门户
                </a>
            </li>
            <li>
                <a href="<?php 
echo Ibos::app()->urlManager->createUrl('weibo/home/index');
?>
">
                    <i class="o-portal-personal"></i>
                    个人门户
                </a>
            </li>
            <?php 
if (ModuleUtil::getIsEnabled('app')) {
    ?>
                <li >
                    <a href="<?php 
    echo Ibos::app()->urlManager->createUrl('app/default/index');
    ?>
">
                        <i class="o-portal-app"></i>
                        应用门户
                    </a>
                </li>
            <?php 
}
?>
        </ul>
    </div>
Esempio n. 25
0
 public static function getOffTime()
 {
     if (ModuleUtil::getIsEnabled("calendar")) {
         $workTime = explode(",", Ibos::app()->setting->get("setting/calendarworkingtime"));
         $offTime = $workTime[1];
         $ret = self::handleOffTime($offTime);
     } else {
         $ret = "18.00";
     }
     return $ret;
 }