PHP Method User::checkPermission, codiad Code Examples

This page contains top rated real world PHP examples of method User::checkPermission from package codiad extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
Show file File: Form.php Project: dudusouza/wowadmin
0
 /**
  * Retorna os widgets da view
  * @param string $viewname nome da view
  * @param string $location localização do widget dentro da view
  * @return boolean
  */
 public function getWidgets($viewname, $location)
 {
     foreach ($this->arrViews as $viewname) {
         $viewname = '\\admin\\lib\\views\\' . $viewname;
         /* @var $viewObj \admin\lib\Views */
         $viewObj = new $viewname();
         $viewObj->setForm($this);
         if ($this->userObj->checkPermission($viewObj->getPermission())) {
             return $viewObj->getWidget($viewname, $location);
         }
     }
     return false;
 }
Example #2
Show file File: usergroup_list.php Project: nrueckmann/yeager
0
<?php

$tmpUser = new User(sUserMgr()->getCurrentUserID());
$tmpUserInfo = $tmpUser->get();
$adminAllowed = $tmpUser->checkPermission('RUSERGROUPS');
$mode = $this->request->parameters['mode'];
if ($mode == "details") {
    $objecttype = $this->request->parameters['yg_type'];
    if ($objecttype == 'mailing') {
        // Get usergroups assigned to mailing
        $mailingID = $this->request->parameters['yg_id'];
        $mailingID = explode('-', $mailingID);
        $mailingID = $mailingID[0];
        $mailingMgr = new MailingMgr();
        $mailing = $mailingMgr->getMailing($mailingID);
        $mailingInfo = $mailing->get();
        // Get assigned groups
        $usergroups = $mailing->getUsergroups();
        foreach ($usergroups as $usergroup_idx => $usergroup) {
            $usergroups[$usergroup_idx]['RDELETE'] = true;
            $usergroups[$usergroup_idx]['SHOW_DELETE'] = true;
        }
        $object_permissions['RWRITE'] = $mailing->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $mailingID, "RWRITE");
        $object_permissions['RSTAGE'] = $mailing->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $mailingID, "RSTAGE");
        $object_permissions['READONLY'] = !$object_permissions['RWRITE'];
        // Get current locks for this token (and unlock them)
        $lockToken = sGuiUS() . '_' . $this->request->parameters['win_no'];
        $lockedObjects = $mailingMgr->getLocksByToken($lockToken);
        foreach ($lockedObjects as $lockedObject) {
            $currentObject = $mailingMgr->getMailing($lockedObject['OBJECTID']);
            $currentObject->releaseLock($lockedObject['TOKEN']);
Example #3
Show file File: site_list.php Project: nrueckmann/yeager
0
<?php

$tmpUser = new User(sUserMgr()->getCurrentUserID());
$tmpUserInfo = $tmpUser->get();
$adminAllowed = $tmpUser->checkPermission('RSITES');
if ($adminAllowed) {
    $siteMgr = new Sites();
    $sites = $siteMgr->getList();
}
$smarty->assign("sites", $sites);
$smarty->assign("win_no", $this->request->parameters['win_no']);
$smarty->display('file:' . $this->page_template);
Example #4
Show file File: config_views.php Project: nrueckmann/yeager
0
<?php

$tmpUser = new User(sUserMgr()->getCurrentUserID());
$tmpUserInfo = $tmpUser->get();
$adminAllowed = $tmpUser->checkPermission('RVIEWS');
if ($adminAllowed) {
    $viewMgr = new Views();
    $views = $viewMgr->getList();
}
$empty_info = array('NAME' => '', 'ID' => '__NEW__', 'WIDTH' => '0', 'HEIGHT' => '0', 'WIDTHCROP' => 0, 'HEIGHTCROP' => 0, 'CONSTRAINHEIGHT' => 0, 'CONSTRAINWIDTH' => 0);
$user = new User(sUserMgr()->getCurrentUserID());
$smarty->assign("RVIEWS", $user->checkPermission("RVIEWS"));
$smarty->assign('views', $views);
$smarty->assign('empty_info', $empty_info);
$smarty->assign('win_no', $this->request->parameters['win_no']);
$smarty->display('file:' . $this->page_template);
Example #5
Show file File: updates.php Project: nrueckmann/yeager
0
<?php

$tmpUser = new User(sUserMgr()->getCurrentUserID());
$tmpUserInfo = $tmpUser->get();
$adminAllowed = $tmpUser->checkPermission('RUPDATER');
if ($adminAllowed) {
    session_start();
    //sApp()
    $this->yeager_version = $versionp;
    //$this->yeager_revision = YEAGER_REVISION;
    //$this->yeager_date = YEAGER_DATE;
    $databaseInfo = sConfig()->getVars('CONFIG/DB');
    $databaseHost = $databaseInfo[0]['host'];
    $databaseHost = explode(':', $databaseHost);
    if (count($databaseHost) > 1) {
        $databasePort = $databaseHost[1];
        $databaseHost = $databaseHost[0];
    } else {
        $databasePort = '3306';
        $databaseHost = $databaseHost[0];
    }
    $_SESSION['APPINFO'] = array('VERSION' => $this->yeager_version, 'REVISION' => $this->yeager_revision, 'DATABASE_SERVER' => $databaseHost, 'DATABASE_PORT' => $databasePort, 'DATABASE_USER' => $databaseInfo[0]['user'], 'DATABASE_PASSWORD' => $databaseInfo[0]['password'], 'DATABASE_NAME' => $databaseInfo[0]['db'], 'PATH_BASE' => dirname($_SERVER['SCRIPT_FILENAME']) . '/');
    $updateMgr = new Updater();
    $updates = $updateMgr->getUpdates();
    $currVersion = $updateMgr->current_version_string;
    $currRevision = $this->yeager_revision;
    //$currDate = explode('-', substr(YEAGER_DATE, 6, 11));
    //$currDate = gmmktime(0, 0, 0, $currDate[1], $currDate[2], $currDate[0]);
    $currDate = '';
}
$winID = $this->request->parameters['win_no'];
Example #6
Show file File: y.php Project: nrueckmann/yeager
0
 public function go()
 {
     header("Content-Type: text/html; charset=UTF-8");
     // Import Libraries
     \framework\import("org.yeager.framework.tools.password");
     \framework\import("org.yeager.ui.common");
     \framework\import("org.yeager.ui.koala");
     \framework\import("org.yeager.ui.icons");
     \framework\import("org.yeager.framework.tools.password");
     \framework\import("org.yeager.framework.tools.http.redirect");
     \framework\import("org.yeager.framework.tools.http.byteserve");
     \framework\import("org.yeager.core.versionable");
     \framework\import("org.yeager.core.tree");
     \framework\import("org.yeager.core.permissions");
     \framework\import("org.yeager.core.privileges");
     \framework\import("org.yeager.core.propertysettings");
     \framework\import("org.yeager.core.properties");
     \framework\import("org.yeager.core.history");
     \framework\import("org.yeager.core.jsqueue");
     \framework\import("org.yeager.core.tags");
     \framework\import("org.yeager.core.comments");
     \framework\import("org.yeager.core.cblock");
     \framework\import("org.yeager.core.cblockmgr");
     \framework\import("org.yeager.core.entrymasks");
     \framework\import("org.yeager.core.page");
     \framework\import("org.yeager.core.pagemgr");
     \framework\import("org.yeager.core.file");
     \framework\import("org.yeager.core.filemgr");
     \framework\import("org.yeager.core.filetypes");
     \framework\import("org.yeager.core.views");
     \framework\import("org.yeager.core.mailing");
     \framework\import("org.yeager.core.mailingmgr");
     \framework\import("org.yeager.core.templates");
     \framework\import("org.yeager.core.usergroups");
     \framework\import("org.yeager.core.sites");
     \framework\import("org.yeager.core.languages");
     \framework\import("org.yeager.core.reftracker");
     \framework\import("org.yeager.core.scheduler");
     \framework\import("org.yeager.core.extensionmgr");
     \framework\import("org.yeager.core.extensions");
     \framework\import("org.yeager.core.fileprocessor");
     \framework\import("org.yeager.core.cblockprocessor");
     \framework\import("org.yeager.core.emailprocessor");
     \framework\import("org.yeager.core.pageprocessor");
     \framework\import("org.yeager.core.user");
     \framework\import("org.yeager.core.usermgr");
     \framework\import("org.yeager.core.tree");
     \framework\import('org.yeager.core.updater');
     \framework\import('org.yeager.core.archive');
     // Set UTF8 for DB
     Singleton::YDB()->Execute("SET NAMES 'utf8';");
     // Set ADODB-Fetchmode to ADODB_FETCH_ASSOC
     Singleton::YDB()->SetFetchMode(ADODB_FETCH_ASSOC);
     // Create instance of Koala class
     $koala = new Koala($this->yeager);
     $username = $this->session->getSessionVar("username");
     $password = $this->session->getSessionVar("password");
     Singleton::register("session", $this->session);
     Singleton::register("request", $this->request);
     Singleton::register("config", $this->config);
     Singleton::register("UserMgr", new UserMgr());
     Singleton::register("guiUS", $this->request->parameters['us']);
     Singleton::register("guiLH", $this->request->parameters['lh']);
     // Get frontend timezone
     $this->frontendTimezone = (string) Singleton::config()->getVar('CONFIG/TIMEZONES/FRONTEND');
     if (!$this->frontendTimezone) {
         $this->frontendTimezone = 'Europe/Berlin';
     }
     $userID = Singleton::UserMgr()->validate($username, $password);
     Singleton::register("Usergroups", new Usergroups());
     if (!$userID) {
         $userID = Singleton::UserMgr()->getAnonymousID();
         $this->authenticated = false;
     } else {
         $this->authenticated = true;
         if ($userID != Singleton::UserMgr()->getAnonymousID()) {
             $this->session->setPSessionVar("username", $username);
             $this->session->setPSessionVar("password", $password);
             $this->session->setPSessionVar("userid", $userID);
             $this->session->setPSessionVar("isvalidated", true);
         }
         if ($this->session->getSessionVar('keepLoggedIn')) {
             $this->session->cookie_time = time() + 60 * 60 * 24 * 365;
         } else {
             $cookie_time = (int) Singleton::config()->getVar("CONFIG/SESSION/COOKIES/TIME");
             $this->session->cookie_time = $cookie_time;
         }
     }
     // write roles to sessions for cachekey
     $user = new User($userID);
     $roles = $user->getUsergroupIDs();
     if ($userID != Singleton::UserMgr()->getAnonymousID()) {
         $this->session->setPSessionVar("userroles", $roles);
         $this->session->setPSessionVar("userid", $userID);
         $this->session->setCookie("yg-userid", $userID);
         $roleHash = "";
         foreach ($roles as $r) {
             $roleHash .= $r["ID"] . "x";
         }
         $this->session->setCookie("yg-userroles", $roleHash);
     } elseif ($_COOKIE['yg-userid']) {
         // remove cookie if set
         $this->session->removeCookie("yg-userid");
         $this->session->removeCookie("yg-userroles");
     }
     $backendAllowed = $user->checkPermission('RBACKEND');
     if ((!$this->authenticated || !$backendAllowed) && $this->frontendMode != 'true') {
         if ($this->page != 'responder' && ($this->request->parameters['handler'] != 'userLogin' || $this->request->parameters['handler'] != 'recoverLogin' || $this->request->parameters['handler'] != 'setNewPassword')) {
             $header = $_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden';
             header($header);
             echo $header;
             die;
         }
     }
     $user_timezone = $user->properties->getValue('TIMEZONE');
     $timezoneAbbreviations = timezone_abbreviations_list();
     foreach ($timezoneAbbreviations as $timezoneAbbreviations_item) {
         foreach ($timezoneAbbreviations_item as $timezone_item) {
             if ($timezone_item['timezone_id'] == $user_timezone) {
                 global $tz;
                 $tz = $timezone_item;
             }
         }
     }
     Singleton::register("Tags", new Tags());
     Singleton::register("cbMgr", new CblockMgr());
     Singleton::register("fileMgr", new FileMgr());
     Singleton::register("sites", new Sites());
     Singleton::register("templates", new Templates());
     Singleton::register("entrymasks", new Entrymasks());
     Singleton::register("mailingMgr", new MailingMgr());
     Singleton::register("comments", new Comments());
     Singleton::register("filetypes", new Filetypes());
     Singleton::register("views", new Views());
     Singleton::register("app", $this);
     Singleton::register("koala", $koala);
     $versioninfo = new Updater();
     $versionp = $versioninfo->current_version_string;
     $this->yeager_version = $versionp;
     $this->yeager_revision = substr(YEAGER_REVISION, 4, 7);
     //$this->yeager_date = YEAGER_DATE;
     // get page to display
     if (empty($this->page)) {
         $this->page = "default";
     }
     if (empty($this->action)) {
         $this->action = $this->request->parameters['action'];
     }
     $this->base = $this->request->script_name . "/" . strtolower($this->applicationname);
     /* yeager */
     $this->docpath = Singleton::config()->getVar('CONFIG/DIRECTORIES/DOCPATH');
     $this->docabsolut = $this->baseabsolut = $this->request->prefix . "://" . $this->request->http_host . $this->docpath;
     $this->imgpath = $this->request->prefix . "://" . $this->request->http_host . $this->docpath . "ui/img/";
     $this->doc = $this->app_httproot;
     $this->sid = $this->session->id;
     $this->sidparam = "sid=" . $this->sid;
     // Regular Expressions for URL parsing
     $internalprefix = str_replace('/', '\\/', Singleton::config()->getVar('CONFIG/REFTRACKER/INTERNALPREFIX'));
     $this->URLRegEx1 = '/(.*)' . $internalprefix . '([a-z]*)\\/([0-9]*)(\\/*)(.*)/';
     $this->URLRegEx2 = '/(.*)' . $internalprefix . '([a-z]*)\\/([0-9]*)\\/([0-9]*)(\\/*)(.*)/';
     $filesdir = Singleton::config()->getVar('CONFIG/DIRECTORIES/FILESDIR');
     $filesdoc = Singleton::config()->getVar('CONFIG/DIRECTORIES/FILESDOC');
     $userpicdir = Singleton::config()->getVar('CONFIG/DIRECTORIES/USERPICDIR');
     $embeddedCblockFolder = (int) Singleton::config()->getVar("CONFIG/EMBEDDED_CBLOCKFOLDER");
     if (strlen($filesdir) < 1) {
         $filesdir = "files/";
     }
     if (strlen($userpicdir) < 1) {
         $userpicdir = $filesdir;
     }
     if (strlen($filesdoc) < 1) {
         $filesdoc = "/yeager/files/";
     }
     if (strlen($embeddedCblockFolder) < 1 || $embeddedCblockFolder == 99999) {
         throw new Exception("No or wrong blindfolder configured!");
     }
     $this->filesdir = $filesdir;
     $this->filesdoc = $filesdoc;
     $this->userpicdir = $userpicdir;
     $this->modules = Singleton::config()->getVars("CONFIG/MODULES");
     $this->files_procs = array_merge(Singleton::config()->getVars("CONFIG/FILES_PROCESSORS"), Singleton::config()->getVars("CONFIG/FILE_PROCESSORS"));
     $this->page_procs = Singleton::config()->getVars("CONFIG/PAGE_PROCESSORS");
     $this->cblock_procs = Singleton::config()->getVars("CONFIG/CBLOCK_PROCESSORS");
     $this->email_procs = Singleton::config()->getVars("CONFIG/EMAIL_PROCESSORS");
     $this->filesprocdir = (string) Singleton::config()->getVar("CONFIG/DIRECTORIES/FILES_PROCS");
     $this->pageprocdir = (string) Singleton::config()->getVar("CONFIG/DIRECTORIES/PAGE_PROCS");
     $this->cblockprocdir = (string) Singleton::config()->getVar("CONFIG/DIRECTORIES/CBLOCK_PROCS");
     $this->emailprocdir = (string) Singleton::config()->getVar("CONFIG/DIRECTORIES/EMAIL_PROCS");
     $this->templates = new Templates();
     $this->templatedir = $this->approot . (string) Singleton::config()->getVar('CONFIG/DIRECTORIES/TEMPLATEDIR');
     $this->templatedoc = (string) Singleton::config()->getVar('CONFIG/DIRECTORIES/TEMPLATEDOC');
     $this->templatedirabsolut = $this->request->prefix . "://" . $this->request->http_host . $this->templatedoc;
     $this->extensiondir = (string) Singleton::config()->getVar('CONFIG/DIRECTORIES/EXTENSIONSDIR');
     $this->extensiondoc = (string) Singleton::config()->getVar('CONFIG/DIRECTORIES/EXTENSIONSDOC');
     $this->processordir = (string) Singleton::config()->getVar('CONFIG/DIRECTORIES/PROCESSORSDIR');
     $this->webroot = "/" . rtrim(ltrim((string) Singleton::config()->getVar("CONFIG/DIRECTORIES/WEBROOT"), '/'), '/') . '/';
     if ($this->webroot == "//") {
         $this->webroot = "/";
     }
     $this->devmode = (string) Singleton::config()->getVar('CONFIG/DEVMODE');
     $this->languages = new Languages();
     $forceLangInclude = (string) Singleton::config()->getVar('CONFIG/PAGES/' . strtoupper($this->page) . '/FORCE_LANG_INCLUDE');
     if ($this->frontendMode != 'true' || $forceLangInclude == 'true') {
         // Read default language from config-file
         if ($this->authenticated) {
             $user = new User(Singleton::UserMgr()->getCurrentUserID());
             $langid = $user->getLanguage();
             $langinfo = $this->languages->get($langid);
             $lang = $langinfo["CODE"];
         } else {
             // Check if we have a language which matches the browser-language
             $browserLanguages = array();
             $tmpBrowserLanguages = explode(',', strtoupper(str_replace(' ', '', $_SERVER["HTTP_ACCEPT_LANGUAGE"])));
             foreach ($tmpBrowserLanguages as $tmpBrowserLanguage) {
                 array_push($browserLanguages, substr($tmpBrowserLanguage, 0, 2));
             }
             $browserLanguages = array_values(array_unique($browserLanguages));
             foreach ($browserLanguages as $browserLanguage) {
                 if (!$lang) {
                     if (file_exists($this->approot . "ui/lang/" . $browserLanguage . ".php")) {
                         $lang = $browserLanguage;
                     }
                 }
             }
         }
         // When everything fails, fallback to default language
         if (strlen($lang) < 1) {
             $defaultLanguage = Singleton::config()->getVar('CONFIG/DEFAULT_LANGUAGE');
             $lang = $defaultLanguage ? $defaultLanguage : 'DE';
         }
         require_once $this->approot . "ui/lang/" . $lang . ".php";
     }
     $this->itext =& $itext;
     Singleton::register("itext", $itext);
     if (!is_readable($this->page_file) || is_dir($this->page_file)) {
         $this->error->raise("Page " . $this->page . "'s code (" . $this->page_file . ") not found.", ERR_DEBUG);
     } else {
         $this->error->raise("loading " . $this->page_file, ERR_DEBUG);
         if ($this->page_template != "") {
             require_once "libs/org/smarty/libs/Smarty.class.php";
             $smarty = new Smarty();
             $this->smarty = $smarty;
             $smarty->compile_check = true;
             $smarty->debugging = false;
             $smarty->use_sub_dirs = false;
             // FIXME move to installer
             @mkdir($this->tmpdir . 'templates_compile', 0700);
             @mkdir($this->tmpdir . 'templates_cache', 0700);
             $smarty->compile_dir = $this->tmpdir . 'templates_compile';
             $smarty->cache_dir = $this->tmpdir . 'templates_cache';
             $smarty->force_compile = (string) $this->config->getVar('CONFIG/CACHE/SMARTY_FORCECOMPILE');
             $smarty->caching = 0;
             $smarty->load_filter('output', 'trimwhitespace');
             $smarty->assign("yeager_version", $this->yeager_version);
             $smarty->assign("yeager_revision", $this->yeager_revision);
             //$smarty->assign("yeager_date",$this->yeager_date);
             $smarty->assign("lang", $lang);
             $smarty->assign("docabsolut", $this->docabsolut);
             $smarty->assign("baseabsolut", $this->baseabsolut);
             $smarty->assign("imgpath", $this->imgpath);
             $smarty->assign("internalprefix", (string) Singleton::config()->getVar('CONFIG/REFTRACKER/INTERNALPREFIX'));
             $smarty->assign("request_prefix", $this->request->prefix);
             $smarty->assign("extensiondoc", $this->extensiondoc);
             $smarty->assign("extensiondir", $this->extensiondir);
             $smarty->assign("is_authenticated", $this->authenticated);
             $smarty->assign("base", $this->base);
             $smarty->assign("page", $this->page);
             $smarty->assign("sid", $this->sid);
             $smarty->assign("sidparam", $this->sidparam);
             $smarty->assign("templatedir", $this->templatedir);
             $smarty->assign("templatedoc", $this->templatedoc);
             $smarty->assign("templatedirabsolut", $this->templatedirabsolut);
             $smarty->assign("approot", getRealpath($this->approot));
             $smarty->assign("devmode", $this->devmode);
             $smarty->assign("webroot", $this->webroot);
             $smarty->assign("URLRegEx1", $this->URLRegEx1);
             require_once $this->approot . "libs/org/yeager/ui/smarty_modifiers.php";
         }
         $smarty->assign("itext", $itext);
         Singleton::register("smarty", $smarty);
         if ($_SERVER['HTTP_X_YEAGER_AUTHENTICATION'] == 'suppress') {
             $authHeader = 'X-Yeager-Authenticated: delayed';
         } else {
             $authHeader = 'X-Yeager-Authenticated: ' . ($this->authenticated ? 'true' : 'false');
         }
         header($authHeader);
         if ($this->frontendMode == "true" && $this->cached) {
             // capture ob
             include_once $this->page_file;
             $output = ob_get_clean();
             Singleton::FC()->write("output", $output);
             Singleton::FC()->flush();
             echo $output;
         } else {
             include_once $this->page_file;
         }
         if ($this->frontendMode != 'true') {
             $koala->getQueuedCommands();
             $koala->go();
         }
     }
 }
Example #7
Show file File: config_file-types.php Project: nrueckmann/yeager
0
<?php

$tmpUser = new User(sUserMgr()->getCurrentUserID());
$tmpUserInfo = $tmpUser->get();
$adminAllowed = $tmpUser->checkPermission('RFILETYPES');
if ($adminAllowed) {
    $fileMgr = sFileMgr();
    $filetypes = $fileMgr->filetypes->getList();
}
$empty_info = array('NAME' => '', 'OBJECTID' => '__NEW__', 'COLOR' => 'black', 'PROCESSOR' => 'NONE');
$user = new User(sUserMgr()->getCurrentUserID());
$smarty->assign("RFILETYPES", $user->checkPermission("RFILETYPES"));
$smarty->assign("processors", $this->files_procs);
$smarty->assign('filetypes', $filetypes);
$smarty->assign('empty_info', $empty_info);
$smarty->assign('win_no', $this->request->parameters['win_no']);
$smarty->display('file:' . $this->page_template);
Example #8
Show file File: sites.php Project: nrueckmann/yeager
0
 /**
  * Creates all database tables for the specified Site
  *
  * @param int $id Site Id
  * @param string $name Site name
  * @return bool TRUE on success or FALSE in case of an error
  */
 private function createSiteTables($id, $name)
 {
     $id = (int) $id;
     $name = sYDB()->escape_string($name);
     $sql = "CREATE TABLE `yg_site_" . $id . "_lnk_cb` (\n\t\t  `ID` int(11) NOT NULL AUTO_INCREMENT,\n\t\t  `CBID` int(11) NOT NULL DEFAULT '0',\n\t\t  `CBVERSION` int(11) NOT NULL DEFAULT '0',\n\t\t  `CBPID` int(11) NOT NULL DEFAULT '0',\n\t\t  `PID` int(11) NOT NULL DEFAULT '0',\n\t\t  `PVERSION` int(11) NOT NULL DEFAULT '0',\n\t\t  `ORDERPROD` int(11) NOT NULL DEFAULT '9999',\n\t\t  `TEMPLATECONTENTAREA` varchar(85) NOT NULL DEFAULT '',\n\t\t  PRIMARY KEY (`ID`),\n\t\t  KEY `CBID` (`CBID`,`CBVERSION`),\n\t\t  KEY `CBID_2` (`CBID`,`PID`,`PVERSION`)\n\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
     sYDB()->Execute($sql);
     $sql = "CREATE TABLE `yg_comments_lnk_pages_" . $id . "` (\n\t\t  `ID` int(11) NOT NULL AUTO_INCREMENT,\n\t\t  `OID` int(11) NOT NULL DEFAULT '0',\n\t\t  `COMMENTID` int(11) NOT NULL DEFAULT '0',\n\t\t  `ORDERPROD` int(11) NOT NULL DEFAULT '9999',\n\t\t  PRIMARY KEY (`ID`),\n\t\t  UNIQUE KEY `OID` (`OID`,`COMMENTID`) USING BTREE\n\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8;";
     sYDB()->Execute($sql);
     $sql = "CREATE TABLE `yg_site_" . $id . "_permissions` (\n\t\t  `ID` int(11) NOT NULL AUTO_INCREMENT,\n\t\t  `OID` int(11) NOT NULL DEFAULT '0',\n\t\t  `USERGROUPID` int(11) NOT NULL DEFAULT '0',\n\t\t  `RREAD` smallint(6) NOT NULL DEFAULT '0',\n\t\t  `RWRITE` smallint(6) NOT NULL DEFAULT '0',\n\t\t  `RDELETE` smallint(6) NOT NULL DEFAULT '0',\n\t\t  `RSUB` smallint(6) NOT NULL DEFAULT '0',\n\t\t  `RSTAGE` smallint(6) NOT NULL DEFAULT '0',\n\t\t  `RMODERATE` smallint(6) NOT NULL DEFAULT '0',\n\t\t  `RCOMMENT` smallint(6) NOT NULL DEFAULT '0',\n\t\t  `RSEND` smallint(6) NOT NULL DEFAULT '0',\n\t\t  PRIMARY KEY (`ID`),\n\t\t  KEY `OID` (`OID`,`USERGROUPID`)\n\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8;";
     sYDB()->Execute($sql);
     $user = new User(sUserMgr()->getCurrentUserID());
     $anonGroupId = (int) sConfig()->getVar("CONFIG/SYSTEMUSERS/ANONGROUPID");
     $rolesList = $user->getUsergroups();
     $tmpUser = new User(sUserMgr()->getCurrentUserID());
     for ($r = 0; $r < count($rolesList); $r++) {
         if ($tmpUser->checkPermission('RSITES')) {
             if ($rolesList[$r]["ID"] != $anonGroupId) {
                 $sql = "INSERT INTO\t`yg_site_" . $id . "_permissions`\n\t\t\t\t\t\t\t\t(`OID`, `USERGROUPID`, `RREAD`, `RWRITE`, `RDELETE`, `RSUB`, `RSTAGE`, `RMODERATE`, `RCOMMENT`, `RSEND`)\n\t\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t\t(1, ?, 1, 1, 1, 1, 1, 1, 1, 1);";
                 sYDB()->Execute($sql, $rolesList[$r]["ID"]);
             }
         }
     }
     $sql = "INSERT INTO\t`yg_site_" . $id . "_permissions`\n\t\t\t\t\t(`OID`, `USERGROUPID`, `RREAD`, `RWRITE`, `RDELETE`, `RSUB`, `RSTAGE`, `RMODERATE`, `RCOMMENT`, `RSEND`)\n\t\t\t\tVALUES\n\t\t\t\t\t(1, ?, 1, 0, 0, 0, 0, 0, 0, 0);";
     sYDB()->Execute($sql, $anonGroupId);
     $sql = "CREATE TABLE `yg_site_" . $id . "_properties` (\n\t\t  `ID` int(11) NOT NULL AUTO_INCREMENT,\n\t\t  `OBJECTID` int(11) NOT NULL DEFAULT '0',\n\t\t  `VERSION` int(11) NOT NULL DEFAULT '0',\n\t\t  `APPROVED` smallint(6) NOT NULL DEFAULT '0',\n\t\t  `CREATEDBY` int(11) NOT NULL DEFAULT '0',\n\t\t  `CHANGEDBY` int(11) NOT NULL DEFAULT '0',\n\t\t  `HASCHANGED` int(11) NOT NULL DEFAULT '0',\n\t\t  `TEMPLATEID` int(11) NOT NULL DEFAULT '0',\n\t\t  `COMMENTSTATUS` int(11) NOT NULL DEFAULT '1',\n\t\t  `COMMENTSTATUS_AUTO` int(11) NOT NULL DEFAULT '1',\n\t\t  `NAVIGATION` int(11) NOT NULL DEFAULT '0',\n\t\t  `ACTIVE` int(11) NOT NULL DEFAULT '0',\n\t\t  `HIDDEN` int(11) NOT NULL DEFAULT '0',\n\t\t  `LOCKED` int(11) NOT NULL DEFAULT '0',\n\t\t  `LOCKUID` text NOT NULL,\n\t\t  `TOKEN` text NOT NULL,\n\t\t  `DELETED` int(11) NOT NULL DEFAULT '0',\n\t\t  `CREATEDTS` int(11) NOT NULL DEFAULT '0',\n\t\t  `CHANGEDTS` int(11) NOT NULL DEFAULT '0',\n\t\t  PRIMARY KEY (`ID`),\n\t\t  KEY `OBJECTID` (`OBJECTID`,`VERSION`),\n\t\t  KEY `VERSION` (`VERSION`)\n\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ;\n\t\t";
     sYDB()->Execute($sql);
     $sql = "INSERT INTO `yg_site_" . $id . "_properties` (`OBJECTID`, `VERSION`, `APPROVED`, `CREATEDBY`, `CHANGEDBY`, `HASCHANGED`, `TEMPLATEID`, `NAVIGATION`, `ACTIVE`, `HIDDEN`, `LOCKED`, `DELETED`, `CREATEDTS`, `CHANGEDTS`) VALUES\n\t\t\t\t(1, 0, 1, 1, 0, ?, ?, 0, 1, 0, 0, 0, 0, 0);";
     sYDB()->Execute($sql, sUserMgr()->getCurrentUserID(), sUserMgr()->getCurrentUserID());
     // hotfix for #2260 (in principle we want custom properties per site)
     $siteList = $this->getList();
     $sourceSiteId = (int) $siteList[0]["ID"];
     if (count($siteList) > 0) {
         $sql = "CREATE TABLE `yg_site_" . $id . "_props` AS (SELECT * FROM `yg_site_" . $sourceSiteId . "_props`);";
         sYDB()->Execute($sql);
         $sql = "CREATE TABLE `yg_site_" . $id . "_propslv` AS (SELECT * FROM `yg_site_" . $sourceSiteId . "_propslv`);";
         sYDB()->Execute($sql);
         $sql = "CREATE TABLE `yg_site_" . $id . "_propsv` AS (SELECT * FROM `yg_site_" . $sourceSiteId . "_propsv` WHERE OID < 0);";
         sYDB()->Execute($sql);
     } else {
         // first site
         $sql = "CREATE TABLE `yg_site_" . $id . "_props` (\n\t\t\t  `ID` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t  `NAME` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,\n\t\t\t  `IDENTIFIER` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,\n\t\t\t  `VISIBLE` int(11) NOT NULL DEFAULT '1',\n\t\t\t  `READONLY` int(11) NOT NULL DEFAULT '0',\n\t\t\t  `TYPE` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,\n\t\t\t  `LISTORDER` int(11) NOT NULL DEFAULT '9999',\n\t\t\t  PRIMARY KEY (`ID`)\n\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8;\n\t\t\t";
         sYDB()->Execute($sql);
         $sql = "INSERT INTO `yg_site_" . $id . "_props` (`ID`, `NAME`, `IDENTIFIER`, `VISIBLE`, `READONLY`, `TYPE`, `LISTORDER`) VALUES\n\t\t\t\t\t\t(1, 'Name', 'NAME', 1, 1, 'TEXT', 1),\n\t\t\t\t\t\t(2, 'Title', 'TITLE', 1, 1, 'TEXT', 2),\n\t\t\t\t\t\t(3, 'Description', 'DESCRIPTION', 1, 1, 'TEXTAREA', 3);";
         sYDB()->Execute($sql);
         $sql = "CREATE TABLE IF NOT EXISTS `yg_site_" . $id . "_propslv` (\n\t\t\t\t\t\t`ID` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t`PID` int(11) NOT NULL,\n\t                    `VALUE` varchar(50) NOT NULL,\n\t                    `LISTORDER` int(11) NOT NULL DEFAULT '9999',\n\t                    PRIMARY KEY (`ID`),\n\t                    KEY `LISTORDER` (`LISTORDER`,`PID`)\n\t\t\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
         sYDB()->Execute($sql);
         $sql = "CREATE TABLE IF NOT EXISTS `yg_site_" . $id . "_propsv` (\n\t\t\t\t\t\t`OID` int(11) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t`NAME` text,\n\t\t\t\t\t\t`TITLE` text,\n\t\t\t\t\t\t`DESCRIPTION` text,\n\t\t\t\t\t\tPRIMARY KEY (`OID`)\n\t\t\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
         sYDB()->Execute($sql);
     }
     $sql = "INSERT INTO `yg_site_" . $id . "_propsv` (`OID`, `NAME`, `TITLE`, `DESCRIPTION`) VALUES\n\t\t\t\t\t(1, ?, NULL, NULL);";
     sYDB()->Execute($sql, $name);
     $sql = "CREATE TABLE IF NOT EXISTS `yg_site_" . $id . "_tree` (\n\t\t  `ID` int(11) NOT NULL AUTO_INCREMENT,\n\t\t  `LFT` int(11) NOT NULL DEFAULT '0',\n\t\t  `RGT` int(11) NOT NULL DEFAULT '0',\n\t\t  `VERSIONPUBLISHED` int(11) NOT NULL DEFAULT '0',\n\t\t  `MOVED` int(11) NOT NULL DEFAULT '0',\n\t\t  `TITLE` text,\n\t\t  `LEVEL` int(11) NOT NULL DEFAULT '0',\n\t\t  `PARENT` int(11) NOT NULL DEFAULT '0',\n\t\t  `PNAME` text,\n\t\t  PRIMARY KEY (`ID`),\n\t\t  KEY `LFT_2` (`LFT`,`RGT`),\n\t\t  KEY `LFT` (`LFT`,`RGT`)\n\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ;\n\t\t";
     sYDB()->Execute($sql);
     $sql = "INSERT INTO `yg_site_" . $id . "_tree` (`ID`, `LFT`, `RGT`, `VERSIONPUBLISHED`, `MOVED`, `TITLE`, `LEVEL`, `PARENT`, `PNAME`) VALUES\n\t\t(1, 1, 2, 0, 0, '', 1, 0, ?);";
     sYDB()->Execute($sql, $name);
     $sql = "CREATE TABLE IF NOT EXISTS `yg_site_" . $id . "_tree_history` (\n\t\t  `ID` int(11) NOT NULL AUTO_INCREMENT,\n\t\t  `OID` int(11) NOT NULL DEFAULT '0',\n\t\t  `DATETIME` int(11) DEFAULT NULL,\n\t\t  `TEXT` text NOT NULL,\n\t\t  `UID` int(11) NOT NULL DEFAULT '0',\n\t\t  `TYPE` int(11) NOT NULL,\n\t\t  `TARGETID` int(11) NOT NULL,\n\t\t  `OLDVALUE` text NOT NULL,\n\t\t  `NEWVALUE` text NOT NULL,\n\t\t  PRIMARY KEY (`ID`),\n\t\t  KEY `OID` (`OID`)\n\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8  ;";
     sYDB()->Execute($sql);
     $sql = "CREATE TABLE IF NOT EXISTS `yg_site_" . $id . "_cron` (\n\t\t  `ID` int(11) NOT NULL AUTO_INCREMENT,\n\t\t  `OBJECTTYPE` int(11) NOT NULL,\n\t\t  `OBJECTID` int(11) NOT NULL,\n\t\t  `ACTIONCODE` varchar(15) COLLATE utf8_unicode_ci NOT NULL,\n\t\t  `TIMESTAMP` bigint(20) NOT NULL,\n\t\t  `EXPIRES` bigint(20) NOT NULL,\n\t\t  `PARAMETERS` text COLLATE utf8_unicode_ci NOT NULL,\n\t\t  `USERID` int(11) NOT NULL,\n\t\t  `STATUS` int(11) NOT NULL,\n\t\t  PRIMARY KEY (`ID`)\n\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
     sYDB()->Execute($sql);
     return true;
 }
Example #9
Show file File: config_comments.php Project: nrueckmann/yeager
0
<?php

$tmpUser = new User(sUserMgr()->getCurrentUserID());
$tmpUserInfo = $tmpUser->get();
$adminAllowed = $tmpUser->checkPermission('RCOMMENTCONFIG');
if ($adminAllowed) {
    $commentsObject = new Comments();
    $commentsSettings = $commentsObject->getSettings();
}
$smarty->assign('commentsSettings', $commentsSettings);
$smarty->assign('adminAllowed', $adminAllowed);
$smarty->assign('refresh', $this->request->parameters['refresh']);
$smarty->assign('win_no', $this->request->parameters['win_no']);
$smarty->display('file:' . $this->page_template);
Example #10
Show file File: config_properties.php Project: nrueckmann/yeager
0
            $object_type = 'cblock';
            break;
        case 'tab_config_file-properties':
            // File
            $fileMgr = sFileMgr();
            $properties_object = $fileMgr->properties;
            $object_type = 'file';
            break;
        case 'tab_config_user-properties':
            // User
            $properties_object = sUserMgr()->properties;
            $object_type = 'user';
            break;
    }
    $object_properties = $properties_object->getList('LISTORDER');
    foreach ($object_properties as $object_properties_idx => $object_properties_item) {
        if ($object_properties_item['TYPE'] == 'LIST') {
            $listentries = $properties_object->getListValues($object_properties_item['IDENTIFIER']);
            $object_properties[$object_properties_idx]['LVALUES'] = $listentries;
        }
    }
    $empty_infos = array(1 => array('TYPE' => 'TEXT', 'ID' => '#<<new_id>>', 'NAME' => '', 'IDENTIFIER' => '', 'LVALUES' => ''), 2 => array('TYPE' => 'TEXTAREA', 'ID' => '#<<new_id>>', 'NAME' => $itext['TXT_NEW_OBJECT'], 'IDENTIFIER' => '', 'LVALUES' => ''), 3 => array('TYPE' => 'RICHTEXT', 'ID' => '#<<new_id>>', 'NAME' => $itext['TXT_NEW_OBJECT'], 'IDENTIFIER' => '', 'LVALUES' => ''), 4 => array('TYPE' => 'CHECKBOX', 'ID' => '#<<new_id>>', 'NAME' => $itext['TXT_NEW_OBJECT'], 'IDENTIFIER' => '', 'LVALUES' => ''), 5 => array('TYPE' => 'LINK', 'ID' => '#<<new_id>>', 'NAME' => $itext['TXT_NEW_OBJECT'], 'IDENTIFIER' => '', 'LVALUES' => ''), 6 => array('TYPE' => 'FILE', 'ID' => '#<<new_id>>', 'NAME' => $itext['TXT_NEW_OBJECT'], 'IDENTIFIER' => '', 'LVALUES' => ''), 7 => array('TYPE' => 'TAG', 'ID' => '#<<new_id>>', 'NAME' => $itext['TXT_NEW_OBJECT'], 'IDENTIFIER' => '', 'LVALUES' => ''), 8 => array('TYPE' => 'CBLOCK', 'ID' => '#<<new_id>>', 'NAME' => $itext['TXT_NEW_OBJECT'], 'IDENTIFIER' => '', 'LVALUES' => ''), 9 => array('TYPE' => 'LIST', 'ID' => '#<<new_id>>', 'NAME' => $itext['TXT_NEW_OBJECT'], 'IDENTIFIER' => '', 'LVALUES' => ''), 10 => array('TYPE' => 'PAGE', 'ID' => '#<<new_id>>', 'NAME' => $itext['TXT_NEW_OBJECT'], 'IDENTIFIER' => '', 'LVALUES' => ''), 11 => array('TYPE' => 'DATE', 'ID' => '#<<new_id>>', 'NAME' => $itext['TXT_NEW_OBJECT'], 'IDENTIFIER' => '', 'LVALUES' => ''), 12 => array('TYPE' => 'DATETIME', 'ID' => '#<<new_id>>', 'NAME' => $itext['TXT_NEW_OBJECT'], 'IDENTIFIER' => '', 'LVALUES' => ''), 13 => array('TYPE' => 'HEADLINE', 'ID' => '#<<new_id>>', 'NAME' => $itext['TXT_NEW_OBJECT'], 'IDENTIFIER' => '', 'LVALUES' => ''), 14 => array('TYPE' => 'PASSWORD', 'ID' => '#<<new_id>>', 'NAME' => $itext['TXT_NEW_OBJECT'], 'IDENTIFIER' => '', 'LVALUES' => ''));
    $user = new User(sUserMgr()->getCurrentUserID());
    $smarty->assign("RPROPERTIES", $user->checkPermission("RPROPERTIES"));
}
$smarty->assign('adminAllowed', $adminAllowed);
$smarty->assign('empty_infos', $empty_infos);
$smarty->assign('object_properties', $object_properties);
$smarty->assign('object_type', $object_type);
$smarty->assign('win_no', $this->request->parameters['win_no']);
$smarty->display('file:' . $this->page_template);
Example #11
Show file File: responder.php Project: nrueckmann/yeager
0
        $field->property = $element['yg_property'] ? $element['yg_property'] : null;
        $field->yg_id = $element['yg_id'] ? $element['yg_id'] : null;
        $fields[$field->property] = $field;
        $field = null;
    }
    $this->fields = $fields;
    $data[1] = $data[1][0];
}
// Load code specific to ajaxaction mapped in configfile
$this->rawdata = $data[1];
$this->elements = $elements;
$this->handler = $this->request->parameters['handler'];
$action = $this->handler;
// Check if user is authenticated and allowed to access the backend
$tmpUser = new User(Singleton::UserMgr()->getCurrentUserID());
$backendAllowed = $tmpUser->checkPermission('RBACKEND');
if ((!$this->authenticated || !$backendAllowed) && ($action != 'userLogin' && $action != 'recoverLogin' && $action != 'setNewPassword')) {
    $header = $_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden';
    header($header);
    echo $header;
    die;
}
$this->code = sConfig()->getVar('CONFIG/AJAXACTIONS/' . strtoupper($this->handler) . '/CODE');
$this->event = $data[0];
$indexname = $this->rawdata['yg_property'] ? $this->rawdata['yg_property'] : null;
$this->responsedata = array();
$this->reponsedata[$indexname]->id = $this->rawdata['id'];
if ($this->rawdata['name']) {
    $this->reponsedata[$indexname]->name = $this->rawdata['name'];
}
$this->reponsedata[$indexname]->value = strlen($this->rawdata['value']) || is_array($this->rawdata['value']) ? $this->rawdata['value'] : null;
Example #12
Show file File: properties.php Project: nrueckmann/yeager
0
         $object_permissions['RWRITE'] = $user->checkPermission("REXTENSIONS_MAILING");
     }
 case 'extimport':
     if ($siteID == 'extimport') {
         $object_permissions['RWRITE'] = $user->checkPermission("RIMPORT");
     }
 case 'extexport':
     if ($siteID == 'extexport') {
         $object_permissions['RWRITE'] = $user->checkPermission("REXPORT");
     }
 case 'extcolistview':
     // Call callback
     $extension->callExtensionHook('onRenderExtensionAdmin');
     $properties = $extension->extensionProperties;
     $propertySettings = $extension->extensionPropertySettings;
     if ($siteID == 'extcolistview') {
         $object_permissions['RWRITE'] = $user->checkPermission("REXTENSIONS_CBLISTVIEW");
     }
     break;
 case 'data':
     // Call callback
     $extension->callExtensionHook('onRenderDataAdmin');
     switch ($objectInfo['TYPE']) {
         case EXTENSION_IMPORT:
             // Import
             $properties = $extension->importProperties;
             $propertySettings = $extension->importPropertySettings;
             break;
         case EXTENSION_EXPORT:
             // Export
             $properties = $extension->exportProperties;
             $propertySettings = $extension->exportPropertySettings;
             break;
     }
     $object_permissions['RWRITE'] = $user->checkPermission("RDATA");
Example #13
Show file File: entrymasks_nodes.php Project: nrueckmann/yeager
0
<?php

header('Content-type: text/xml');
$tmpUser = new User(sUserMgr()->getCurrentUserID());
$tmpUserInfo = $tmpUser->get();
$adminAllowed = $tmpUser->checkPermission('RENTRYMASKS');
if ($adminAllowed || $this->request->parameters['selectiondialog'] == '1' || $this->request->parameters['action'] == 'insertcontent') {
    $icons = new Icons();
    $selectiondialog = $this->request->parameters['selectiondialog'];
    if ($selectiondialog || $selectiondialog == "1" || $this->request->parameters['action'] == 'insertcontent') {
        $noclick = 'noclick';
    } else {
        $noclick = '';
    }
    // All entrymasks
    $entrymaskMgr = new Entrymasks();
    $entrymasks = $entrymaskMgr->getList();
    $yo = $entrymaskMgr->tree->nest($entrymasks);
    $xml_tree = array();
    $tree_id = 0;
    $tree_level = 0;
    $props = array('TREE_ID' => $tree_id, 'TREE_LEVEL' => $tree_level, 'ID' => 'root_1', 'CAPTION' => $itext['TXT_ENTRYMASKS'] != '' ? $itext['TXT_ENTRYMASKS'] : '$TXT_ENTRYMASKS', 'URL' => $root_link, 'IC' => $this->imgpath . '/window/x.gif', 'EXP' => 'true', 'CHK' => 'false', 'CSTSTYLE' => 'root nodelete', 'TARGET' => '', 'TITLE' => '', 'YG_ID' => $entrymasks[0]['ID'] . '-entrymask', 'YG_TYPE' => 'entrymask', 'YG_PROPERTY' => 'name', 'DND' => 'false', 'XTRA' => $noclick);
    array_push($xml_tree, array('OBJECTID' => $tree_id, 'LEVEL' => $tree_level++, 'PROPS' => $props));
    gen_tree($yo[1]['CHILDREN'], $icons->icon, $this->imgpath, $xml_tree, $tree_id, $tree_level, $noclick);
}
function gen_tree($current, $icons, $imgpath, &$xml_tree, &$tree_id, &$tree_level, $noclick)
{
    while (list($key, $value) = each($current)) {
        if ($current[$key]['FOLDER']) {
            $img = $imgpath . 'icons/ico_folder_s.png,' . $imgpath . 'icons/ico_folderopen_s.png';
            $cststyle = '';
Example #14
Show file File: config_mailings.php Project: nrueckmann/yeager
0
<?php

$ygid = $this->request->parameters['yg_id'];
$refresh = $this->request->parameters['refresh'];
$tmpUser = new User(sUserMgr()->getCurrentUserID());
$tmpUserInfo = $tmpUser->get();
$adminAllowed = $tmpUser->checkPermission('RMAILINGCONFIG');
if ($adminAllowed) {
    $mailingMgr = new MailingMgr();
    $templateMgr = new Templates();
    $defaultTemplate = $mailingMgr->getDefaultTemplate();
    $templateRoot = $mailingMgr->getTemplateRoot();
    if ($defaultTemplate) {
        $templateInfo = $templateMgr->getTemplate($defaultTemplate);
        $templateInfo['PREVIEWPATH'] = $templateMgr->getPreviewPath($defaultTemplate);
    }
    if ($templateRoot) {
        $templateRootInfo = $templateMgr->getTemplate($templateRoot);
    }
}
$smarty->assign('mode', 1);
$smarty->assign('adminAllowed', $adminAllowed);
$smarty->assign('templateInfo', $templateInfo);
$smarty->assign('templaterootinfo', $templateRootInfo);
$smarty->assign('defaultTemplate', $defaultTemplate);
$smarty->assign('templateRoot', $templateRoot);
$smarty->assign('refresh', $refresh);
$smarty->assign('win_no', $this->request->parameters['win_no']);
$smarty->display('file:' . $this->page_template);
Example #15
Show file File: frameset.php Project: nrueckmann/yeager
0
$backendAllowed = $user->checkPermission('RBACKEND');
if (!$backendAllowed) {
    $this->session->setPSessionVar('username', '');
    $this->session->setPSessionVar('password', '');
    $this->session->setPSessionVar('isvalidated', false);
}
$userinfo['PROPS'] = $user->properties->getValues(sUserMgr()->getCurrentUserID());
$smarty->assign("RPAGES", $user->checkPermission("RPAGES"));
$smarty->assign("RCONTENTBLOCKS", $user->checkPermission("RCONTENTBLOCKS"));
$smarty->assign("RCOMMENTS", $user->checkPermission("RCOMMENTS"));
$smarty->assign("RMAILINGS", $user->checkPermission("RMAILINGS"));
$smarty->assign("RFILES", $user->checkPermission("RFILES"));
$smarty->assign("RTAGS", $user->checkPermission("RTAGS"));
$smarty->assign("RUSERS", $user->checkPermission("RUSERS"));
$smarty->assign("RUSERGROUPS", $user->checkPermission("RUSERGROUPS"));
$smarty->assign("RDATA", $user->checkPermission("RDATA"));
$smarty->assign("RSITES", $user->checkPermission("RSITES"));
$smarty->assign("RTEMPLATES", $user->checkPermission("RTEMPLATES"));
$smarty->assign("REXTENSIONS_PAGE", $user->checkPermission("REXTENSIONS_PAGE"));
$smarty->assign("REXTENSIONS_MAILING", $user->checkPermission("REXTENSIONS_MAILING"));
$smarty->assign("REXTENSIONS_FILE", $user->checkPermission("REXTENSIONS_FILE"));
$smarty->assign("REXTENSIONS_CBLOCK", $user->checkPermission("REXTENSIONS_CBLOCK"));
$smarty->assign("RENTRYMASKS", $user->checkPermission("RENTRYMASKS"));
$smarty->assign("REXPORT", $user->checkPermission("REXPORT"));
$smarty->assign("RIMPORT", $user->checkPermission("RIMPORT"));
$smarty->assign("REXTENSIONS_CBLISTVIEW", $user->checkPermission("REXTENSIONS_CBLISTVIEW"));
$smarty->assign("RUPDATER", $user->checkPermission("RUPDATER"));
$smarty->assign("RPROPERTIES", $user->checkPermission("RPROPERTIES"));
$smarty->assign("RFILETYPES", $user->checkPermission("RFILETYPES"));
$smarty->assign("RCOMMENTCONFIG", $user->checkPermission("RCOMMENTCONFIG"));
$smarty->assign("RMAILINGCONFIG", $user->checkPermission("RMAILINGCONFIG"));
$smarty->assign("RVIEWS", $user->checkPermission("RVIEWS"));
Example #16
Show file File: users.php Project: nrueckmann/yeager
0
     // Check permissions
     $tmpUser = new User(sUserMgr()->getCurrentUserID());
     $userinfo = $tmpUser->get();
     $perm = array();
     $perm['RPAGES'] = $tmpUser->checkPermission("RPAGES");
     $perm['RCONTENTBLOCKS'] = $tmpUser->checkPermission("RCONTENTBLOCKS");
     $perm['RFILES'] = $tmpUser->checkPermission("RFILES");
     $perm['RTAGS'] = $tmpUser->checkPermission("RTAGS");
     $perm['RUSERS'] = $tmpUser->checkPermission("RUSERS");
     $perm['RUSERGROUPS'] = $tmpUser->checkPermission("RUSERGROUPS");
     $perm['REXTENSIONS_PAGE'] = $tmpUser->checkPermission("REXTENSIONS_PAGE");
     $perm['REXTENSIONS_MAILING'] = $tmpUser->checkPermission("REXTENSIONS_MAILING");
     $perm['REXTENSIONS_FILE'] = $tmpUser->checkPermission("REXTENSIONS_FILE");
     $perm['REXTENSIONS_CBLOCK'] = $tmpUser->checkPermission("REXTENSIONS_CBLOCK");
     $perm['RIMPORT'] = $tmpUser->checkPermission("RIMPORT");
     $perm['REXPORT'] = $tmpUser->checkPermission("REXPORT");
     $perm['REXTENSIONS_CBLISTVIEW'] = $tmpUser->checkPermission("REXTENSIONS_CBLISTVIEW");
     $perm['RUPDATER'] = $tmpUser->checkPermission("RUPDATER");
     $perm['RDATA'] = $tmpUser->checkPermission("RDATA");
     $perm['RSITES'] = $tmpUser->checkPermission("RSITES");
     $perm['RTEMPLATES'] = $tmpUser->checkPermission("RTEMPLATES");
     $perm['RENTRYMASKS'] = $tmpUser->checkPermission("RENTRYMASKS");
     $perm['RPROPERTIES'] = $tmpUser->checkPermission("RPROPERTIES");
     $perm['RFILETYPES'] = $tmpUser->checkPermission("RFILETYPES");
     $perm['RCOMMENTCONFIG'] = $tmpUser->checkPermission("RCOMMENTCONFIG");
     $perm['RVIEWS'] = $tmpUser->checkPermission("RVIEWS");
     $perm['RBACKEND'] = $tmpUser->checkPermission("RBACKEND");
     if ($perm['RBACKEND']) {
         $isValidated = true;
     }
 }
Example #17
Show file File: tree_templates.php Project: nrueckmann/yeager
0
<?php

$siteID = $this->request->parameters['site'];
$pageID = $this->request->parameters['page'];
$action = $this->request->parameters['action'];
$tmpUser = new User(sUserMgr()->getCurrentUserID());
$tmpUserInfo = $tmpUser->get();
$adminAllowed = $tmpUser->checkPermission('RPAGES');
if (!$adminAllowed) {
    $adminAllowed = $tmpUser->checkPermission('RTEMPLATES');
}
if ($adminAllowed) {
    if ($action == 'choose' && $siteID && $pageID) {
        if ($siteID == 'mailing') {
            $mailingMgr = new MailingMgr();
            $mailing = $mailingMgr->getMailing($pageID);
            $mailingInfo = $mailing->get();
            $preselected = $mailingInfo["TEMPLATEID"];
        } else {
            $pageMgr = new PageMgr($siteID);
            $page = $pageMgr->getPage($pageID);
            $pageInfo = $page->get();
            $preselected = $pageInfo["TEMPLATEID"];
        }
    }
    if ($action == 'choosefolder') {
        // Check if folders are available
        $templateMgr = new Templates();
        $siteMgr = new Sites();
        $siteinfo = $siteMgr->get($siteID);
        $templatesTree = $templateMgr->getList();
Example #18
Show file File: extension_list.php Project: nrueckmann/yeager
0
 case 'extpage':
     $adminAllowed = $tmpUser->checkPermission('REXTENSIONS_PAGE');
     $extensiontype = EXTENSION_PAGE;
     break;
 case 'extcblock':
     $adminAllowed = $tmpUser->checkPermission('REXTENSIONS_CBLOCK');
     $extensiontype = EXTENSION_CBLOCK;
     break;
 case 'extfile':
     $adminAllowed = $tmpUser->checkPermission('REXTENSIONS_FILE');
     $extensiontype = EXTENSION_FILE;
     break;
 case 'extmailing':
     $adminAllowed = $tmpUser->checkPermission('REXTENSIONS_MAILING');
     $extensiontype = EXTENSION_MAILING;
     break;
 case 'extimport':
     $adminAllowed = $tmpUser->checkPermission('RIMPORT');
     $extensiontype = EXTENSION_IMPORT;
     break;
 case 'extexport':
     $adminAllowed = $tmpUser->checkPermission('REXPORT');
     $extensiontype = EXTENSION_EXPORT;
     break;
 case 'extcolistview':
     $adminAllowed = $tmpUser->checkPermission('REXTENSIONS_CBLISTVIEW');
     $extensiontype = EXTENSION_CBLOCKLISTVIEW;
     break;
 case 'data':
     $adminAllowed = $tmpUser->checkPermission('RDATA');
     switch ($extensiontype) {