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