Skip to content
Snippets Groups Projects

Hotline#16112 intranet compte redacteur

Merged Laurent requested to merge hotline#16112_intranet_compte_redacteur into hotline_6.51
Compare and
+ 72
51
Preferences
Compare changes
Files
@@ -16,20 +16,11 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//////////////////////////////////////////////////////////////////////////////////////
// OPAC3 : IDENTIFICATION
//////////////////////////////////////////////////////////////////////////////////////
class Admin_AuthController extends Zend_Controller_Action
{
//----------------------------------------------------------------------------------
// On utilise le layout : sansMenuGauche.phtml
//----------------------------------------------------------------------------------
function init()
{
class Admin_AuthController extends Zend_Controller_Action {
function init() {
$viewRenderer = $this->getHelper('ViewRenderer');
$viewRenderer->setLayoutScript('sansMenuGauche.phtml');
}
@@ -37,16 +28,13 @@ class Admin_AuthController extends Zend_Controller_Action
//----------------------------------------------------------------------------------
// Retour à l'accueil apres authentification
//----------------------------------------------------------------------------------
function indexAction()
{
function indexAction() {
$this->_redirect('admin/');
}
//----------------------------------------------------------------------------------
// Formulaire d'identification
//----------------------------------------------------------------------------------
function loginAction() {
$this->view->message = '';
$this->view->message = '';
if (!$this->_request->isPost())
return;
@@ -56,22 +44,26 @@ class Admin_AuthController extends Zend_Controller_Action
$password = $f->filter($this->_request->getPost('password'));
if (empty($username)) {
$this->view->message = "Entrez votre nom d'utilisateur puis validez S.V.P.";
$this->view->message = $this->_("Entrez votre nom d'utilisateur puis validez S.V.P.");
return;
}
$auth = ZendAfi_Auth::getInstance();
if ($auth->authenticateLoginPassword($username, $password, [$auth->newAuthDb()]))
$this->_redirect('admin/');
if (!$auth->authenticateLoginPassword($username, $password, [$auth->newAuthDb()]))
return;
$this->_redirect(
Class_Profil::getCurrentProfil()->isPublic()
? 'admin/'
: 'opac/index/index/id_profil/'.Class_Profil::getCurrentProfil()->getId());
}
//----------------------------------------------------------------------------------
// Deconnexion de l'utilisateur
//----------------------------------------------------------------------------------
function logoutAction()
{
function logoutAction() {
ZendAfi_Auth::getInstance()->clearIdentity();
$this->_redirect('admin/');
}
}
?>
\ No newline at end of file