openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

LanguagelistAction.class.php (1785B)


      1 <?php
      2 
      3 namespace cms\action;
      4 
      5 use cms\base\Configuration;
      6 use cms\model\Folder;
      7 use cms\model\Language;
      8 use cms\model\Permission;
      9 use cms\model\Project;
     10 use language\Messages;
     11 use util\exception\SecurityException;
     12 use util\Html;
     13 
     14 
     15 // OpenRat Content Management System
     16 // Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de
     17 //
     18 // This program is free software; you can redistribute it and/or
     19 // modify it under the terms of the GNU General Public License
     20 // as published by the Free Software Foundation; either version 2
     21 // of the License, or (at your option) any later version.
     22 //
     23 // This program is distributed in the hope that it will be useful,
     24 // but WITHOUT ANY WARRANTY; without even the implied warranty of
     25 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     26 // GNU General Public License for more details.
     27 //
     28 // You should have received a copy of the GNU General Public License
     29 // along with this program; if not, write to the Free Software
     30 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
     31 
     32 
     33 /**
     34  * Action-Klasse f?r die Bearbeitung einer Sprache
     35  * @version $Id$
     36  * @author  $Author$
     37  * @package openrat.actions
     38  */
     39 class LanguagelistAction extends BaseAction
     40 {
     41     /**
     42      * @var Project
     43      */
     44     protected $project;
     45 
     46 
     47     /**
     48 	 * Konstruktor
     49 	 */
     50 	function __construct()
     51 	{
     52         parent::__construct();
     53 
     54     }
     55 
     56 
     57     public function init()
     58     {
     59 
     60         $this->project = new Project( $this->request->getId());
     61 	}
     62 
     63 	/**
     64 	 * User must be an project administrator.
     65 	 */
     66 	public function checkAccess() {
     67 		$rootFolderId = $this->project->getRootObjectId();
     68 
     69 		$rootFolder = new Folder( $rootFolderId );
     70 		$rootFolder->load();
     71 
     72 		if   ( ! $rootFolder->hasRight( Permission::ACL_PROP )  )
     73 			throw new SecurityException();
     74 	}
     75 
     76 }