/**
  * Checks if user is author of page
  * @param bit $action what the caller wants to do
  *
  * returns true of access is allowed
  */
 function isMyItem($action)
 {
     global $_zp_current_admin_obj;
     if (parent::isMyItem($action)) {
         return true;
     }
     if (zp_loggedin($action)) {
         if ($_zp_current_admin_obj->getUser() == $this->getAuthor()) {
             return true;
         }
         $mypages = $_zp_current_admin_obj->getObjects('pages');
         if (!empty($mypages)) {
             if (array_search($this->getTitlelink(), $mypages) !== false) {
                 return true;
             }
         }
     }
     return false;
 }
 /**
  * Checks if user is news author
  * @param bit $action what the caller wants to do
  *
  * returns true of access is allowed
  */
 function isMyItem($action)
 {
     global $_zp_current_admin_obj;
     if (parent::isMyItem($action)) {
         return true;
     }
     if (zp_loggedin($action)) {
         if (GALLERY_SECURITY != 'public' && $this->getShow() && $action == LIST_RIGHTS) {
             return LIST_RIGHTS;
         }
         if ($_zp_current_admin_obj->getUser() == $this->getAuthor()) {
             return true;
             //	he is the author
         }
         if ($this->getShow() && $action == LIST_RIGHTS) {
             return true;
         }
         $mycategories = $_zp_current_admin_obj->getObjects('news');
         if (!empty($mycategories)) {
             foreach ($this->getCategories() as $category) {
                 $cat = new ZenpageCategory($category['titlelink']);
                 if ($cat->isMyItem(ZENPAGE_NEWS_RIGHTS)) {
                     // only override item visibility if we "own" the category
                     return true;
                 }
             }
         }
     }
     return false;
 }
Beispiel #3
0
 /**
  * Checks if user is author of page
  * @param bit $action what the caller wants to do
  *
  * returns true of access is allowed
  */
 function isMyItem($action)
 {
     global $_zp_current_admin_obj;
     if (parent::isMyItem($action)) {
         return true;
     }
     if (zp_loggedin($action)) {
         if (GALLERY_SECURITY != 'public' && $this->getShow() && $action == LIST_RIGHTS) {
             return LIST_RIGHTS;
         }
         if ($_zp_current_admin_obj->getUser() == $this->getAuthor()) {
             return true;
         }
         $mypages = $_zp_current_admin_obj->getObjects('pages');
         if (!empty($mypages)) {
             if (array_search($this->getTitlelink(), $mypages) !== false) {
                 return true;
             }
         }
     }
     return false;
 }
 /**
  * Checks if user is news author
  * @param bit $action what the caller wants to do
  *
  * returns true of access is allowed
  */
 function isMyItem($action)
 {
     global $_zp_current_admin_obj;
     if (parent::isMyItem($action)) {
         return true;
     }
     if (zp_loggedin($action)) {
         if ($_zp_current_admin_obj->getUser() == $this->getAuthor()) {
             return true;
             //	he is the author
         }
         $mycategories = $_zp_current_admin_obj->getObjects('news');
         if (!empty($mycategories)) {
             foreach ($this->getCategories() as $category) {
                 if (array_search($category['titlelink'], $mycategories) !== false) {
                     return true;
                 }
             }
         }
     }
     return false;
 }