Beispiel #1
0
 /**
  * Constructor of the Extension class
  *
  * @param string $code Extension code
  */
 public function __construct($code)
 {
     $code = sYDB()->escape_string($code);
     $this->_code = $code;
     $this->_uid =& sUserMgr()->getCurrentUserID();
     $this->extensionProperties = new Properties("yg_ext_" . $this->_code . "_props", 1);
     $this->extensionPropertySettings = new PropertySettings("yg_ext_" . $this->_code . "_props");
 }
Beispiel #2
0
 /**
  * Constructor of the JSQueue class
  *
  * @param object $permissions Permissions Object
  * @param int $siteId Site Id
  */
 function __construct($permissions, $siteId = 0)
 {
     $this->_table = "yg_jsqueue";
     $this->_sourceid = HISTORYTYPE_JSQUEUE;
     $this->_siteID = (int) $siteId;
     $this->_uid =& sUserMgr()->getCurrentUserID();
     $this->permissions =& $permissions;
 }
Beispiel #3
0
 /**
  * Constructor of the Entrymasks class
  */
 function __construct()
 {
     $this->_db = sYDB();
     $this->_uid =& sUserMgr()->getCurrentUserID();
     $this->table = "yg_entrymasks_tree";
     $this->tree = new Tree($this);
     $this->permissions = new Permissions("yg_entrymasks_permissions", $this);
 }
Beispiel #4
0
 /**
  * Constructor of the Templates class
  */
 function __construct()
 {
     $this->_uid = sUserMgr()->getCurrentUserID();
     $this->table = "yg_templates_tree";
     $this->tree = new tree($this);
     $this->permissions = new Permissions("yg_templates_permissions", $this);
     $this->setDir((string) sConfig()->getVar('CONFIG/DIRECTORIES/TEMPLATEDIR'));
 }
Beispiel #5
0
 public function onRender($args = NULL)
 {
     $page = $this->getPage();
     $pageinfo = $page->get();
     $action = sApp()->request->parameters['ACTION'];
     // check if commenting user is authenticated
     $anonymousUserID = sUserMgr()->getAnonymousID();
     if ((int) sUserMgr()->getCurrentUserID() == $anonymousUserID) {
         $isLoggedIn = false;
     } else {
         $isLoggedIn = true;
     }
     // get comment infos
     $commentError = NULL;
     $commentObject = $page->comments;
     $commentSettings = $commentObject->getSettings();
     $commentStatus = $commentObject->getStatus($pageinfo['ID']);
     $commentPermission = $page->permissions->check(sUserMgr()->getCurrentUserID(), 'RCOMMENT', $pageinfo['ID']);
     // add comment
     if ($action == 'ADD') {
         $commentUser = sApp()->request->parameters['USER'];
         $commentEmail = sApp()->request->parameters['EMAIL'];
         $commentText = sApp()->request->parameters['TEXT'];
         $result = $commentObject->add($commentText, $pageinfo['ID'], $commentUser, $commentEmail);
         if ($result !== ERROR_NONE) {
             switch ($result) {
                 case ERROR_COMMENTS_MINIMUM_POST_INTERVAL_EXCEEDED:
                     $commentError = 'Minimum post interval was exceeded.';
                     break;
                 case ERROR_COMMENTS_BLACKLISTED_WORD:
                     $commentError = 'You have used a blacklisted word.';
                     break;
                 case ERROR_COMMENTS_AUTHENTICATION_NEEDED:
                     $commentError = 'Authentication is needed.';
                     break;
                 case ERROR_COMMENTS_COMMENTING_IS_CLOSED:
                     $commentError = 'Commenting is closed.';
                     break;
                 case ERROR_COMMENTS_NO_COMMENT_RIGHTS:
                     $commentError = 'No permissions to comment.';
                     break;
                 default:
                     $commentError = 'An unknown error has occured.';
                     break;
             }
         }
     }
     // get comments - has to be after add functionaly in order for new comments to show up
     $commentCount = $commentObject->getCommentsCount();
     $comments = $commentObject->getComments($pageinfo['ID'], NULL);
     sSmarty()->assign("isLoggedIn", $isLoggedIn);
     sSmarty()->assign("commentError", $commentError);
     sSmarty()->assign("commentCount", $commentCount);
     sSmarty()->assign("commentPermission", $commentPermission);
     sSmarty()->assign("commentSettings", $commentSettings);
     sSmarty()->assign("commentStatus", $commentStatus);
     sSmarty()->assign("comments", $comments);
 }
Beispiel #6
0
 /**
  * Constructor of the History class
  *
  * @param int $sourceId Source Id
  * @param object $permissions Permissions Object
  * @param int $siteId Site Id
  */
 function __construct(&$object = NULL, $sourceId, $permissions, $siteId = 0)
 {
     $this->_table = "yg_history";
     $this->_sourceid = $sourceId;
     $this->_siteID = (int) $siteId;
     $this->_uid =& sUserMgr()->getCurrentUserID();
     $this->_object =& $object;
     $this->permissions =& $permissions;
 }
Beispiel #7
0
 /**
  * Constructor of the Tag class
  *
  * @param object $object Object from which the Tag class was instantiated
  */
 function __construct(&$object = NULL)
 {
     $this->_db = sYDB();
     $this->_uid =& sUserMgr()->getCurrentUserID();
     $this->table = "yg_tags_tree";
     $this->tree = new tree($this);
     $this->permissions = new Permissions("yg_tags_permissions", $this);
     $this->_object =& $object;
     $this->fetchIdentifiers();
 }
Beispiel #8
0
 /**
  * Constructor of the Scheduler class
  *
  * @param string $table Database table for the Scheduler instance
  * @param int $objecttype Object type
  */
 function __construct($table, $objecttype)
 {
     $this->_uid = sUserMgr()->getCurrentUserID();
     $objecttype = (int) $objecttype;
     $this->_table = $table;
     $this->_objecttype = $objecttype;
     if (strlen($table) < 2) {
         return false;
     }
 }
Beispiel #9
0
 /**
  * Constructor of the Properties class
  *
  * @param string $table Name of the table into which the Properties will be saved
  * @param int $propertyId Property Id (versioned Object Id)
  */
 function __construct($table = '', $propertyId = NULL, &$object = NULL)
 {
     $this->_table = $table;
     $this->_uid =& sUserMgr()->getCurrentUserID();
     if ($propertyId == NULL) {
         return;
     }
     $this->_property_id = $propertyId;
     if ($object) {
         $this->_object =& $object;
     }
 }
Beispiel #10
0
 /**
  * Constructor of the PageMgr class
  */
 public function __construct()
 {
     $this->_db = sYDB();
     $this->_uid =& sUserMgr()->getCurrentUserID();
     $this->_config = $config;
     $this->table = "yg_mailing_tree";
     $this->tree = new tree($this);
     $this->permissions = new Permissions("yg_mailing_permissions", $this);
     $this->history = new History($this, "mailing", $this->permissions);
     $this->tags = new Tags($this);
     $this->properties = new PropertySettings("yg_mailing_props");
     $this->scheduler = new Scheduler("yg_cron", SCHEDULER_MAILING);
     $this->templates = new Templates();
 }
Beispiel #11
0
 /**
  * Constructor of the CblockMgr class
  */
 function __construct()
 {
     $this->_db = sYDB();
     $this->_uid = sUserMgr()->getCurrentUserID();
     $this->table = "yg_contentblocks_tree";
     $this->tree = new tree($this);
     $this->permissions = new Permissions($this->getPermissionsTable(), $this);
     $this->history = new History($this, HISTORYTYPE_CO, $this->permissions);
     $this->tags = new Tags($this);
     $this->properties = new PropertySettings("yg_contentblocks_props");
     $this->tags->_dobjectpropertytable = "yg_contentblocks_propsv";
     $this->scheduler = new Scheduler("yg_cron", SCHEDULER_CO);
     $this->control = new Entrymasks();
 }
Beispiel #12
0
 /**
  * Constructor of the File class
  *
  * @param int $fileId File Id
  * @param int $version Version
  */
 public function __construct($fileId = 0, $version = 0)
 {
     $this->_uid =& sUserMgr()->getCurrentUserID();
     $this->_id = $fileId;
     $this->initTables();
     $this->permissions = new Permissions($this->_table_permissions, $this);
     parent::__construct($this->_id, $version, $this->_table_object, $this->_table_tree, $this->permissions);
     $this->history = new History($this, HISTORYTYPE_FILE, $this->permissions);
     $this->tags = new Tags($this);
     $this->comments = new Comments($this);
     $this->properties = new Properties($this->_table_properties, $this->getPropertyId(), $this);
     $this->scheduler = new Scheduler($this->_table_scheduler, SCHEDULER_FILE);
     $this->views = new Views($this);
     $this->filetypes = new Filetypes();
 }
Beispiel #13
0
 /**
  * Constructor of the PageMgr class
  *
  * @param int $siteId Site Id
  */
 public function __construct($siteId)
 {
     $this->_db = sYDB();
     $this->_uid =& sUserMgr()->getCurrentUserID();
     $this->_config = $config;
     $this->_site = (int) $siteId;
     $this->table = "yg_site_" . $this->_site . "_tree";
     $this->tree = new tree($this);
     $this->permissions = new Permissions("yg_site_" . $this->_site . "_permissions", $this);
     $this->history = new History($this, "site_" . $this->_site, $this->permissions, $this->_site);
     $this->tags = new Tags($this);
     $this->properties = new PropertySettings("yg_site_" . $this->_site . "_props");
     $this->scheduler = new Scheduler("yg_site_" . $this->_site . "_cron", SCHEDULER_PAGE);
     $this->templates = new Templates();
 }
Beispiel #14
0
 /**
  * Constructor of the Cblock class
  *
  * @param int $cbId Cblock Id
  * @param int $version Version
  */
 public function __construct($cbId = 0, $version = 0)
 {
     $this->_uid =& sUserMgr()->getCurrentUserID();
     // object descriptor
     $this->_id = $cbId;
     $this->initTables();
     $this->permissions = new Permissions($this->_table_permissions, $this);
     parent::__construct($this->_id, $version, $this->_table_object, $this->_table_tree, $this->permissions);
     $this->history = new History($this, HISTORYTYPE_CO, $this->permissions);
     $this->tags = new Tags($this);
     $this->properties = new Properties($this->_table_properties, $this->getPropertyId(), $this);
     $this->scheduler = new Scheduler($this->_table_scheduler, SCHEDULER_CO);
     $this->control = new Entrymasks();
     $this->comments = new Comments($this);
 }
Beispiel #15
0
 /**
  * Constructor of the Page class
  *
  * @param int $siteID Site Id
  * @param int $pageID Page Id
  * @param int $version Version
  */
 public function __construct($siteID = 1, $pageID = 0, $version = 0)
 {
     $this->_uid =& sUserMgr()->getCurrentUserID();
     if ($siteID < 1) {
         return false;
     }
     $this->_site = $siteID;
     $this->_id = $pageID;
     $this->initTables();
     $this->permissions = new Permissions($this->_table_permissions, $this);
     parent::__construct($this->_id, $version, $this->_table_object, $this->_table_tree, $this->permissions);
     $this->history = new History($this, $this->_id_history, $this->permissions, $this->_site);
     $this->tags = new Tags($this);
     $this->comments = new Comments($this);
     $this->properties = new Properties($this->_table_properties, $this->getPropertyId(), $this);
     $this->scheduler = new Scheduler($this->_table_scheduler, SCHEDULER_PAGE);
 }
Beispiel #16
0
$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"));
$smarty->assign("browser", $browser);
$smarty->assign("browserversion", $browserversion);
$smarty->assign("platform", $platform);
$smarty->assign("user_session", $koala->genSequence());
$smarty->assign("username", $userinfo['PROPS']['FIRSTNAME'] . ' ' . $userinfo['PROPS']['LASTNAME']);
$smarty->assign("userid", sUserMgr()->getCurrentUserID());
$smarty->assign("preview", $this->request->parameters['preview']);
$smarty->assign("objecttype", $this->request->parameters['objecttype']);
$smarty->assign("objectid", $this->request->parameters['id']);
$smarty->assign("objectsite", $this->request->parameters['site']);
$smarty->assign("objectview", $this->request->parameters['view']);
$smarty->assign("previewversion", $this->request->parameters['version']);
$smarty->assign("devmode", (string) sApp()->devmode);
$smarty->assign("queueid", $queueid);
$smarty->display('file:' . $this->page_template);
Beispiel #17
0
 $a = 0;
 $linkedmailings = array();
 $linkedtomailings = $cbb->getLinkedMailingVersions(true);
 if (count($linkedtomailings) > 0) {
     for ($x = 0; $x < count($linkedtomailings); $x++) {
         $linkmailingid = $linkedtomailings[$x]['ID'];
         $lMailing = $mailingMgr->getMailing($linkmailingid);
         $mailingversions = $lMailing->getVersionsByCblockId($contentblock['ID']);
         $linkedMailingInfo = $lMailing->get();
         $linkedmailings[$a]['MAILINGID'] = $linkmailingid;
         $linkedmailings[$a]['HASH'] = $linkmailingid;
         $linkedmailings[$a]['MAILINGNAME'] = $linkedMailingInfo['NAME'];
         $linkedmailings[$a]['HASCHANGED'] = $linkedtomailings[$x]['HASCHANGED'];
         $linkedmailings[$a]['VERSIONS'] = $pageversions;
         $linkedMailingInfo['RWRITE'] = $lMailing->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $linkmailingid, 'RWRITE');
         $linkedMailingInfo['RDELETE'] = $lMailing->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $linkmailingid, 'RDELETE');
         $linkedmailings[$a]['MAILINGINFO'] = $linkedMailingInfo;
         $linkedmailings[$a]['ICON'] = 'mailing';
         if ($linkedmailings[$a]['HASCHANGED']) {
             //$linkedmailings[$a]['STYLE'] = 'changed';
         }
         $a++;
     }
 }
 $mailingsHash = '';
 foreach ($linkedmailings as $linkedmailingsItem) {
     $mailingsHash .= $linkedmailingsItem['HASH'] . '#';
 }
 foreach ($linkedmailings as $linkedmailingsItem) {
     $contentblocks_blind[$idx]['MAILINGS'][] = $linkedmailingsItem;
 }
Beispiel #18
0
        $lockedByUser['PROPS'] = $userWithLock->properties->getValues($mailingStatus['UID']);
        $smarty->assign('lockedByUser', $lockedByUser);
        $object_permissions['RWRITE'] = false;
    }
    $object_permissions['READONLY'] = !$object_permissions['RWRITE'];
} else {
    $object_permissions = array();
    $object_permissions["RWRITE"] = sUsergroups()->permissions->check(sUserMgr()->getCurrentUserID(), 'RUSERS');
    if (sUserMgr()->getAnonymousID() == (int) $userID) {
        $object_permissions['RWRITE'] = 0;
        $object_permissions['READONLY'] = 1;
    }
}
$smarty->assign("object_permissions", $object_permissions);
// Check rights
$rroles = sUsergroups()->permissions->check(sUserMgr()->getCurrentUserID(), 1, 'RUSERGROUPS');
$empty_item = array('ID' => '#<<new_id>>', 'NAME' => '#<<new_name>>', 'SHOW_DELETE' => true);
$smarty->assign("mode", $mode);
$smarty->assign("rootGroupId", $rootGroupId);
$smarty->assign("anonGroupId", $anonGroupId);
$smarty->assign("rroles", $rroles);
$smarty->assign("objecttype", $objecttype);
$smarty->assign("yg_id", $this->request->parameters['yg_id']);
$smarty->assign("empty_item", $empty_item);
$smarty->assign("usergroups", $usergroups);
if ($this->request->parameters['action'] == 'addrole') {
    $smarty->assign('selectiondialog', true);
}
$smarty->assign("win_no", $this->request->parameters['win_no']);
$smarty->assign("action", $this->request->parameters['action']);
$smarty->assign("opener_reference", $this->request->parameters['opener_reference']);
Beispiel #19
0
 /**
  * Checks if a specific File exists
  *
  * @param int $fileId File Id
  * @return bool TRUE if file exists, FALSE if not
  */
 public function fileExists($fileId)
 {
     sUserMgr()->impersonate(sUserMgr()->getAdministratorID());
     $check = sFileMgr()->getFile($fileId);
     sUserMgr()->unimpersonate();
     if ($check) {
         return true;
     } else {
         return false;
     }
     sUserMgr()->unimpersonate();
 }
Beispiel #20
0
 /**
  * Removes this User from a Usergroup
  *
  * @param int $usergroupId Usergroup Id
  */
 function removeUsergroup($usergroupId)
 {
     $uid = (int) $this->id;
     if (sUsergroups()->permissions->check($this->_uid, 'RUSERS') || $uid == $this->_uid) {
         $usergroupId = (int) $usergroupId;
         if ($usergroupId > 0) {
             // admin user requires admin role, cannot be removed
             if (sUserMgr()->getAdministratorID() == $uid) {
                 if ($usergroupId == (int) sConfig()->getVar("CONFIG/SYSTEMUSERS/ROOTGROUPID")) {
                     return false;
                 }
             }
             $sql = "DELETE FROM\n\t\t\t\t`yg_user_lnk_usergroups`\n\t\t\t\tWHERE\n\t\t\t\tUID = ? AND USERGROUPID = ?;";
             sYDB()->Execute($sql, $uid, $usergroupId);
         }
         return true;
     } else {
         return false;
     }
 }
Beispiel #21
0
 /**
  * Copies Properties, Extensions, Usergroups, Permissions, Tags, assigned and embedded Cblocks
  * from another Mailing into a new version of this Mailing
  *
  * @param object $sourceMailing Source Mailing object
  * @return bool TRUE on success or FALSE in case of an error
  * @throws Exception
  */
 public function copyFrom(&$sourceMailing)
 {
     $targetID = (int) $this->_id;
     if ($this->permissions->checkInternal($this->_uid, $targetID, "RWRITE")) {
         $sourceInfo = $sourceMailing->get();
         $targetVersion = $this->getVersion();
         parent::copyFrom($sourceMailing);
         $this->setTemplate($sourceInfo['TEMPLATEID']);
         $assignedGroups = $sourceMailing->getUsergroups();
         foreach ($assignedGroups as $assignedGroup) {
             if (sUsergroups()->usergroupPermissions->checkInternal(sUserMgr()->getCurrentUserID(), $assignedGroup['ID'], 'RREAD')) {
                 $this->addUsergroup($assignedGroup['ID'], $targetVersion);
             }
         }
         $this->copyExtensionsFrom($sourceMailing);
         // Clear contentareas
         $mailingInfo = $this->get();
         $templateMgr = new Templates();
         $contentareas = $templateMgr->getContentareas($mailingInfo['TEMPLATEID']);
         for ($i = 0; $i < count($contentareas); $i++) {
             $mailinglist = $this->getCblockList($contentareas[$i]['CODE']);
             for ($x = 0; $x < count($mailinglist); $x++) {
                 $this->removeCblock($mailinglist[$x]['ID'], $contentareas[$i]['CODE']);
             }
         }
         $templateMgr = new Templates();
         $mailingInfo = $sourceMailing->get();
         $contentareas = $templateMgr->getContentareas($mailingInfo['TEMPLATEID']);
         for ($i = 0; $i < count($contentareas); $i++) {
             $cbListOrder = array();
             $mailinglist = $sourceMailing->getCblockList($contentareas[$i]['CODE']);
             for ($x = 0; $x < count($mailinglist); $x++) {
                 $coid = $mailinglist[$x]['OBJECTID'];
                 // Check if we have a blind contentblock
                 if ($mailinglist[$x]['EMBEDDED'] == 1) {
                     // Yes, we have to copy it to the blind folder
                     // Check which entrymasks are contained
                     $srcCo = sCblockMgr()->getCblock($coid, $mailinglist[$x]['VERSION']);
                     $src_entrymasks = $srcCo->getEntrymasks();
                     // Create blind contentblocks with these entrymasks
                     foreach ($src_entrymasks as $src_entrymask_item) {
                         // Add new contentblock to folder
                         $contentblockID = $this->addCblockEmbedded($contentareas[$i]['CODE']);
                         $newCo = sCblockMgr()->getCblock($contentblockID);
                         $newCo->properties->setValue("NAME", $src_entrymask_item['ENTRYMASKNAME']);
                         // Add requested control to contentblock
                         $new_control = $newCo->addEntrymask($src_entrymask_item['ENTRYMASKID']);
                         // Loop through all formfields
                         $controlFormfields = $srcCo->getFormfieldsInternal($src_entrymask_item['LINKID']);
                         $newControlFormfields = $newCo->getFormfieldsInternal($new_control);
                         // Fill all formfield parameter values with content from the source formfield
                         for ($c = 0; $c < count($newControlFormfields); $c++) {
                             $newCo->setFormfield($newControlFormfields[$c]['ID'], $controlFormfields[$c]['VALUE01'], $controlFormfields[$c]['VALUE02'], $controlFormfields[$c]['VALUE03'], $controlFormfields[$c]['VALUE04'], $controlFormfields[$c]['VALUE05'], $controlFormfields[$c]['VALUE06'], $controlFormfields[$c]['VALUE07'], $controlFormfields[$c]['VALUE08']);
                         }
                     }
                 } else {
                     // No, it's a normal one, just link it to the mailing
                     $this->addCblockLink($coid, $contentareas[$i]['CODE']);
                 }
                 $cbListOrder[] = $coid;
             }
             $this->setCblockOrder($cbListOrder, $contentareas[$i]['CODE']);
         }
         $this->markAsChanged();
     } else {
         return false;
     }
 }
Beispiel #22
0
<?php

$userid = $this->request->parameters['userid'];
$user = new User($userid);
$userinfo = $user->get();
$userinfo['PROPS'] = $user->properties->getValues($userid);
$userinfo['LANGUAGE'] = $user->getLanguage();
$userroles = $user->getUsergroups($userid);
$languageMgr = new Languages();
$languages = $languageMgr->getList();
$userpicture = sUserMgr()->getUserImage($userid, 48, 48);
if (!$userpicture) {
    $userpicture = $this->imgpath . 'content/temp_userpic.png';
}
$koala->queueScript('Koala.windows[\'wid_' . $this->request->parameters['win_no'] . '\'].setUserHeader(\'' . $userpicture . '\',\'' . $userinfo['PROPS']['FIRSTNAME'] . ' ' . $userinfo['PROPS']['LASTNAME'] . '\',\'' . $userinfo['PROPS']['COMPANY'] . '\', \'' . $userinfo['ID'] . '\');');
$smarty->assign('userinfo', $userinfo);
$smarty->assign('userroles', $userroles);
$smarty->assign('userpicture', $userpicture);
$smarty->assign("win_no", $this->request->parameters['win_no']);
$smarty->display('file:' . $this->page_template);
Beispiel #23
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();
Beispiel #24
0
 // 3 = rdelete
 // 4 = parent -> rsub & rwrite
 // 5 = parent -> rsub & rwrite
 // 6 = rdelete
 $buttons = array();
 // Get Parents
 $parentid = $tagMgr->getParents($node);
 $parentid = $parentid[0][0]['ID'];
 // Check rights
 $rread = $tagMgr->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $node, "RREAD");
 $rwrite = $tagMgr->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $node, "RWRITE");
 $rsub = $tagMgr->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $node, "RSUB");
 $rdelete = $tagMgr->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $node, "RDELETE");
 // Check rights of parents
 $prsub = $tagMgr->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $parentid, "RSUB");
 $prwrite = $tagMgr->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $parentid, "RWRITE");
 // Check permissions for button "add"
 if ($rsub) {
     $koala->queueScript("if (\$('wid_" . $wid . "_addbutton'))  \$('wid_" . $wid . "_addbutton').removeClassName('disabled')");
     $buttons[0] = true;
 } else {
     $koala->queueScript("if (\$('wid_" . $wid . "_addbutton'))  \$('wid_" . $wid . "_addbutton').addClassName('disabled')");
     $buttons[0] = false;
 }
 // Check permissions for button "copy"
 if ($rread) {
     $buttons[1] = true;
 } else {
     $buttons[1] = false;
 }
 // Check permissions for button "move"
Beispiel #25
0
        $filetypes = $filetypeMgr->getList();
        foreach ($objects as $objects_idx => $objects_item) {
            foreach ($filetypes as $filetypes_item) {
                if ($objects_item['FILETYPE'] == $filetypes_item['OBJECTID']) {
                    $objects[$objects_idx]['TYPEINFO'] = $filetypes_item;
                }
            }
        }
        sUserMgr()->unimpersonate();
        break;
    case 'tags':
        sUserMgr()->impersonate(sUserMgr()->getAdministratorID());
        $tagMgr = new Tags();
        $objects = $tagMgr->getList($obj_id, array('SUBNODES'), true, $maxlevels, $roleid);
        $objects = $tagMgr->getAdditionalTreeInfo(false, $objects);
        sUserMgr()->unimpersonate();
        break;
    case 'usergroups':
        // No subnodes
        break;
    case 'system':
        // No subnodes
        break;
}
$smarty->assign('isRORole', $isRORole);
$smarty->assign("objects", $objects);
$smarty->assign("site", $siteID);
$smarty->assign("objecttype", $yg_type);
$smarty->assign("maxlevels", $maxlevels);
$smarty->assign("leading_lines", $leadingLinesArray);
$smarty->assign("win_no", $this->request->parameters['win_no']);
Beispiel #26
0
     $koala->alert($itext['TXT_MAILING_ERROR_NOT_APPROVED']);
 } elseif (!$mailingInfo['FROM_EMAIL']) {
     $koala->alert($itext['TXT_MAILING_ERROR_NO_SENDER_SET']);
 } elseif (!$mailingInfo['SUBJECT']) {
     $koala->alert($itext['TXT_MAILING_ERROR_NO_SUBJECT_SET']);
 } else {
     $latestFinalVersion = $mailing->getLatestApprovedVersion();
     $mailing = $mailingMgr->getMailing($mailingId, $latestFinalVersion);
     $mailingInfo = $mailing->get();
     // Get assigned groups
     $userGroups = $mailing->getUsergroups();
     // Get all receipients
     $userIds = array();
     foreach ($userGroups as $currUserGroups) {
         // Get # of users in this group
         $usersInRole = sUserMgr()->getByUsergroup($currUserGroups['ID']);
         foreach ($usersInRole as $usersInRoleItem) {
             array_push($userIds, $usersInRoleItem['UID']);
         }
     }
     $userIds = array_unique($userIds);
     // Check if # of recipients > 0
     if (count($userIds) > 0) {
         // Queue emails
         foreach ($userIds as $currUserId) {
             $user = new User($currUserId);
             $userInfo = $user->get();
             $userInfo['PROPERTIES'] = $user->properties->getValues($currUserId);
             $userId = $userInfo['ID'];
             $userEmail = $userInfo['PROPERTIES']['EMAIL'];
             $userFirstName = $userInfo['PROPERTIES']['FIRSTNAME'];
Beispiel #27
0
<?php

$objecttype = $this->request->parameters['objecttype'];
$id = $this->request->parameters['objectid'];
$version = $this->request->parameters['version'];
$onload = $this->request->parameters['onload'];
$user = new User(sUserMgr()->getCurrentUserID());
$userinfo = $user->get();
$userinfo['PROPS'] = $user->properties->getValues(sUserMgr()->getCurrentUserID());
if ($onload == null || $onload == undefined || $onload == '') {
    $onload = false;
}
if ($objecttype == "file") {
    $view = $this->request->parameters['view'];
    $zoom = $this->request->parameters['zoom'];
    $crop = $this->request->parameters['crop'];
    if ($zoom <= 0) {
        $zoom = 100;
    }
    if ($crop == null || $crop == undefined) {
        $crop = false;
    }
    if ($version == '') {
        $file = new File($id);
        $version = $file->getLatestApprovedVersion();
        $file = new File($id, $version);
    } else {
        $file = new File($id, $version);
    }
    $versions = $file->getVersions();
    if ($versions[0]['APPROVED'] == 0) {
Beispiel #28
0
                     $tempformfield['FORMFIELD'] = 12;
                     break;
                 case 'HEADLINE':
                     $tempformfield['FORMFIELD'] = 13;
                     break;
                 case 'CUTLINE':
                     $tempformfield['FORMFIELD'] = 14;
                     break;
                 case 'PAGE':
                     $tempformfield['FORMFIELD'] = 15;
                     if ($props[$c]['VALUE']['site'] && $props[$c]['VALUE']['page']) {
                         $tmpPageMgr = new PageMgr($props[$c]['VALUE']['site']);
                         $tmpPage = $tmpPageMgr->getPage($props[$c]['VALUE']['page']);
                         $info = $tmpPage->get();
                         $info['RWRITE'] = $tmpPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $props[$c]['VALUE']['page'], "RWRITE");
                         $info['RDELETE'] = $tmpPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $props[$c]['VALUE']['page'], "RDELETE");
                         $iconData = getIconForPage($info);
                         $tempformfield['ICON'] = $iconData['iconclass'];
                         $tempformfield['STYLE'] = $iconData['style'];
                         $tempformfield['DISPLAYNAME'] = $info['NAME'];
                     }
                     break;
             }
             $tempformfield['ENTRYMASKFORMFIELD'] = $tempformfield['FORMFIELD'];
             array_push($tempformfields, $tempformfield);
         }
     }
     $ex['ENTRYMASKS'][0]['FORMFIELDS'] = $tempformfields;
     $output[] = $ex;
     $loop++;
 }
Beispiel #29
0
if ($prefix == "YGSOURCE") {
    unset($prefix);
}
// Check if id is pname
if ($request_path[0] == $request_path[1]) {
    $fileMgr = sFileMgr();
    $new_fileId = (int) $fileMgr->getFileIdByPname($fileId);
    if ($new_fileId) {
        $fileId = $new_fileId;
    }
}
$login = $this->session->getSessionVar("username");
$password = $this->session->getSessionVar("password");
$userId = sUserMgr()->validate($login, $password);
if ($userId < 1) {
    $userId = sUserMgr()->getAnonymousID();
}
$version = $this->request->parameters['version'];
$file = sFileMgr()->getFile($fileId, $version);
$fileinfo = false;
if ($file && is_numeric($fileId)) {
    $fileinfo = $file->get();
}
if ($fileinfo && $fileinfo["DELETED"] != 1) {
    if (!$version) {
        $version = $file->getLatestVersion();
    }
    $filedir = $this->approot . $this->filesdir;
    $filepath = $fileinfo["OBJECTID"] . "-" . $fileinfo["VIEWVERSION"] . $fileinfo["FILENAME"];
    sFileMgr()->callExtensionHook("onDownload", $fileId, $version, array("VIEW" => $prefix));
    if (strlen($prefix) > 0 && !is_numeric($prefix)) {
Beispiel #30
0
function renderPage($page, $version, $pageInfo, $pageMgr, $siteInfo)
{
    $templateMgr = new Templates();
    $pageID = $pageInfo["OBJECTID"];
    $templateInfo = $templateMgr->getTemplate($pageInfo["TEMPLATEID"]);
    $templatefilename = $templateInfo["FILENAME"];
    $templatefullpath = $templateMgr->getDir() . $templateInfo["PATH"] . $templatefilename;
    $content = $page->getContent();
    // navi
    $tree = $pageMgr->getList($pageID, array($filter));
    $tree = $pageMgr->getAdditionalTreeInfo($pageID, $tree, true);
    $oldlevel = 0;
    for ($xt = 0; $xt < count($tree); $xt++) {
        if ($oldlevel != $tree[$xt]["LEVEL"] || !$pnames) {
            $tree[$xt]["PARENTS"] = $pnames = $pageMgr->getParents($tree[$xt]["ID"]);
            $oldlevel = $tree[$xt]["LEVEL"];
        } else {
            $tree[$xt]["PARENTS"] = $pnames;
        }
        if ($pageID == $tree[$xt]["ID"]) {
            $pageInfo["PARENTS"] = $pnames;
        }
        $url = "";
        $pi = count($pnames);
        while ($pi > 0) {
            $url .= $pnames[$pi - 1][0]["PNAME"] . "/";
            $pi--;
        }
        $tree[$xt]["PURL"] = $url . $tree[$xt]["PNAME"] . "/";
        $tree[$xt]["URL"] = sApp()->webroot . $url . $tree[$xt]["PNAME"] . "/";
        if ($tree[$xt]["HIDDEN"] == 0 && $tree[$xt]["SHOW"] == 1) {
            $xtc = $xtc + 1;
        }
    }
    $pageMgr->callExtensionHook("onRender", $siteInfo["ID"], $pageID, $version, array("FILTER" => $filter, "CONTENTAREAS" => &$content));
    // Fill userinfo with data from current user
    $currUser = new User(sUserMgr()->getCurrentUserID());
    $userInfo = $currUser->get();
    $userInfo['FULLNAME'] = trim($userInfo['FIRSTNAME'] . ' ' . $userInfo['LASTNAME']);
    sApp()->smarty->assign("user", $userInfo);
    sApp()->smarty->assign("devmode", (string) sApp()->devmode);
    sApp()->smarty->assign("pageinfo", $pageInfo);
    sApp()->smarty->assign("contentareas", $content);
    sApp()->smarty->assign("tree", $tree);
    sApp()->smarty->assign("site", $siteInfo["ID"]);
    sApp()->smarty->assign("siteinfo", $siteInfo);
    sApp()->smarty->assign("sitename", $siteInfo["PNAME"]);
    sApp()->smarty->assign("untitledparams", sApp()->request->untitled_parameters);
    if (!sApp()->output_tmp) {
        if ($templateInfo == NULL) {
            sApp()->output_tmp = "";
        } else {
            sApp()->output_tmp = sApp()->smarty->fetch("file:" . $templatefullpath);
        }
    }
    //2nd pass
    sApp()->smarty->left_delimiter = '[!';
    sApp()->smarty->right_delimiter = '!]';
    sApp()->output = sApp()->smarty->fetch("var:" . sApp()->output_tmp);
    //3rd pass (replace special urls with normal urls)
    sApp()->output = replaceSpecialURLs(sApp()->output);
    echo sApp()->output;
}