[ Index ] |
|
Code source de phpMyVisites 2.3 |
1 <?php 2 /* 3 * phpMyVisites : website statistics and audience measurements 4 * Copyright (C) 2002 - 2006 5 * http://www.phpmyvisites.net/ 6 * phpMyVisites is free software (license GNU/GPL) 7 * Authors : phpMyVisites team 8 */ 9 10 // $Id: AdminUser.class.php 169 2006-11-16 23:13:44Z cmil $ 11 12 13 require_once INCLUDE_PATH."/core/include/AdminModule.class.php"; 14 require_once INCLUDE_PATH."/core/forms/FormUser.class.php"; 15 16 class AdminUser extends AdminModule 17 { 18 var $viewTemplate = "admin/user.tpl"; 19 20 function AdminUser() 21 { 22 parent::AdminModule(); 23 } 24 25 function needAUserSelected() 26 { 27 $idUser = $this->request->getAdminUser(); 28 29 if( !$idUser ) 30 { 31 $o_user =& User::getInstance(); 32 33 $this->tpl->assign( 'users_available', $o_user->getAllUsers() ); 34 $this->tpl->template = "admin/user_selection.tpl"; 35 36 return false; 37 } 38 else 39 { 40 return $idUser; 41 } 42 } 43 function process() 44 { 45 $this->tpl->assign("action", $this->request->getActionName()); 46 47 switch( $this->request->getActionName() ) 48 { 49 case 'add': 50 $form = new FormUser( $this->tpl ); 51 52 $done = $form->process(); 53 54 if($done) 55 { 56 $this->setMessage( ); 57 } 58 break; 59 60 case 'mod': 61 case 'modCur': 62 if ($this->request->getActionName() === 'modCur') { 63 $o_user =& User::getInstance(); 64 $userLogin = $o_user->getLogin(); 65 } 66 else { 67 $userLogin = $this->needAUserSelected(); 68 } 69 70 if($userLogin) 71 { 72 $this->tpl->assign( 'user_selected', $userLogin ); 73 74 $form = new FormUser( $this->tpl, $userLogin ); 75 76 $done = $form->process(); 77 78 if($done) 79 { 80 $this->setMessage( ); 81 } 82 } 83 // else needASiteAdminSelected display the site selection form 84 break; 85 86 case 'del': 87 88 $login = $this->needAUserSelected(); 89 90 if($login && $login != 'anonymous') 91 { 92 $confirmed = $this->needConfirmation( 'user', $login ); 93 94 if($confirmed) 95 { 96 $confUser = new UserConfigDb(); 97 $confUser->delUser( $login ); 98 99 $this->setMessage( ); 100 } 101 } 102 break; 103 } 104 105 // case no site installed, do not generate 106 if(is_a( $this->site, "Site")) 107 { 108 $this->site->generateFiles(); 109 } 110 } 111 } 112 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 14:10:01 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |