UserlistAction.class.php (1850B)
1 <?php 2 3 namespace cms\action; 4 5 use cms\model\User; 6 7 // OpenRat Content Management System 8 // Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de 9 // 10 // This program is free software; you can redistribute it and/or 11 // modify it under the terms of the GNU General Public License 12 // as published by the Free Software Foundation; either version 2 13 // of the License, or (at your option) any later version. 14 // 15 // This program is distributed in the hope that it will be useful, 16 // but WITHOUT ANY WARRANTY; without even the implied warranty of 17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 // GNU General Public License for more details. 19 // 20 // You should have received a copy of the GNU General Public License 21 // along with this program; if not, write to the Free Software 22 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 23 24 25 /** 26 * Action-Klasse zum Bearbeiten eines Benutzers 27 * @author $Author$ 28 * @version $Revision$ 29 * @package openrat.actions 30 */ 31 class UserlistAction extends BaseAction 32 { 33 public $security = Action::SECURITY_ADMIN; 34 35 function __construct() 36 { 37 parent::__construct(); 38 } 39 40 41 function showView() 42 { 43 $list = array(); 44 45 foreach( User::getAllUsers() as $user ) 46 { 47 $list[$user->userid] = $user->getProperties(); 48 $list[$user->userid]['id' ] = $user->userid; 49 } 50 $this->setTemplateVar('el',$list); 51 } 52 53 54 /** 55 * Eigenschaften des Benutzers anzeigen 56 */ 57 function editView() 58 { 59 $this->nextSubAction('show'); 60 } 61 62 63 64 function addView() 65 { 66 } 67 68 69 70 function addPost() 71 { 72 if ( $this->getRequestVar('name') != '' ) 73 { 74 $this->user = new User(); 75 $this->user->add( $this->getRequestVar('name') ); 76 $this->addNotice('user',$this->user->name,'ADDED','ok'); 77 } 78 else 79 { 80 $this->addValidationError('name'); 81 $this->callSubAction('add'); 82 } 83 } 84 85 86 87 88 }