コード例 #1
0
ファイル: AuthUtil.php プロジェクト: AxelPanda/ibos
 public static function getParams($route)
 {
     $positionid = Ibos::app()->user->positionid;
     $dataItems = Node::model()->fetchAllDataNode();
     if (isset($dataItems[$route])) {
         $identifier = $dataItems[$route];
         $param["purvId"] = NodeRelated::model()->fetchDataValByIdentifier($identifier, $positionid);
     } else {
         $param = array();
     }
     return $param;
 }
コード例 #2
0
ファイル: UserController.php プロジェクト: AxelPanda/ibos
 protected function getMaxPurv($uid, $posid, $url)
 {
     $allPosIds = PositionRelated::model()->fetchAllPositionIdByUid($uid);
     array_push($allPosIds, $posid);
     array_unique($allPosIds);
     $purvs = array();
     foreach ($allPosIds as $posid) {
         $p = NodeRelated::model()->fetchDataValByIdentifier($url, $posid);
         $purvs[] = intval($p);
     }
     $viewPurv = max($purvs);
     return $viewPurv;
 }
コード例 #3
0
ファイル: extention.php プロジェクト: AxelPanda/ibos
<?php

Nav::model()->deleteAllByAttributes(array("module" => "workflow"));
Notify::model()->deleteAllByAttributes(array("module" => "workflow"));
NotifyMessage::model()->deleteAllByAttributes(array("module" => "workflow"));
CacheUtil::set("notifyNode", null);
Node::model()->deleteAllByAttributes(array("module" => "workflow"));
NodeRelated::model()->deleteAllByAttributes(array("module" => "workflow"));
AuthItem::model()->deleteAll("name LIKE 'workflow%'");
AuthItemChild::model()->deleteAll("child LIKE 'workflow%'");
MenuCommon::model()->deleteAllByAttributes(array("module" => "workflow"));
$settingFields = "wfremindbefore,wfremindafter,sealfrom";
Setting::model()->deleteAll("FIND_IN_SET(skey,'{$settingFields}')");
Menu::model()->deleteAllByAttributes(array("m" => "workflow"));
Nav::model()->deleteAllByAttributes(array("module" => "workflow"));
Node::model()->deleteAllByAttributes(array("module" => "workflow"));
NodeRelated::model()->deleteAllByAttributes(array("module" => "workflow"));
AuthItem::model()->deleteAll("name LIKE 'workflow%'");
AuthItemChild::model()->deleteAll("child LIKE 'workflow%'");
$db = Ibos::app()->db->createCommand();
$prefix = $db->getConnection()->tablePrefix;
$tables = $db->setText("SHOW TABLES LIKE '" . str_replace("_", "\\_", $prefix . "flow_data_%") . "'")->queryAll(false);
foreach ($tables as $table) {
    $tableName = $table[0];
    !empty($tableName) && $db->dropTable($tableName);
}
コード例 #4
0
ファイル: PositionController.php プロジェクト: AxelPanda/ibos
 private function updateAuthItem($positionId, $authItem = array(), $dataVal = array())
 {
     if (!empty($authItem)) {
         $nodes = Node::model()->fetchAllSortByPk("id");
         NodeRelated::model()->deleteAllByPositionId($positionId);
         $auth = Ibos::app()->authManager;
         $role = $auth->getAuthItem($positionId);
         if ($role === null) {
             $role = $auth->createRole($positionId, "", "", "");
         }
         AuthItemChild::model()->deleteByParent($positionId);
         foreach ($authItem as $key => $nodeId) {
             $node = $nodes[$key];
             if (strcasecmp($key, $nodeId) !== 0 && $nodeId === "data") {
                 $vals = $dataVal[$key];
                 if (is_array($vals)) {
                     NodeRelated::model()->addRelated("", $positionId, $node);
                     foreach ($vals as $id => $val) {
                         $childNode = Node::model()->fetchByPk($id);
                         NodeRelated::model()->addRelated($val, $positionId, $childNode, $id);
                         AuthUtil::addRoleChildItem($role, $childNode, explode(",", $childNode["routes"]));
                     }
                 }
             } else {
                 NodeRelated::model()->addRelated("", $positionId, $node);
                 $routes = explode(",", $node["routes"]);
                 AuthUtil::addRoleChildItem($role, $node, $routes);
             }
         }
     }
 }
コード例 #5
0
ファイル: extention.php プロジェクト: AxelPanda/ibos
<?php

$settingFields = "emailexternalmail,emailrecall,emailsystemremind,emailroleallocation,emaildefsize";
Setting::model()->deleteAll("FIND_IN_SET(skey,'{$settingFields}')");
Setting::model()->updateSettingValueByKey("emailtableids", "a:2:{i:0;i:0;i:1;i:1;}");
Setting::model()->updateSettingValueByKey("emailtable_info", "a:2:{i:0;a:1:{s:4:\"memo\";s:0:\"\";}i:1;a:2:{s:4:\"memo\";s:0:\"\";s:11:\"displayname\";s:12:\"默认归档\";}}");
Nav::model()->deleteAllByAttributes(array("module" => "email"));
Menu::model()->deleteAllByAttributes(array("m" => "email"));
MenuCommon::model()->deleteAllByAttributes(array("module" => "email"));
Notify::model()->deleteAllByAttributes(array("node" => "email_message"));
NotifyMessage::model()->deleteAllByAttributes(array("module" => "email"));
CacheUtil::set("notifyNode", null);
Node::model()->deleteAllByAttributes(array("module" => "email"));
NodeRelated::model()->deleteAllByAttributes(array("module" => "email"));
AuthItem::model()->deleteAll("name LIKE 'email%'");
AuthItemChild::model()->deleteAll("child LIKE 'email%'");
$db = Ibos::app()->db->createCommand();
$prefix = $db->getConnection()->tablePrefix;
$tables = $db->setText("SHOW TABLES LIKE '" . str_replace("_", "\\_", $prefix . "email_%") . "'")->queryAll(false);
foreach ($tables as $table) {
    $tableName = $table[0];
    !empty($tableName) && $db->dropTable($tableName);
}