Location: PHPKode > projects > iF.SVNAdmin > svnadmin/actions/login_authentication.php
<?php
/**
 * iF.SVNAdmin
 * Copyright (c) 2010 by Manuel Freiholz
 * http://www.insanefactory.com/
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; version 2
 * of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.
 */
if( !defined('ACTION_HANDLING') ) {
  die("HaHa!");
}

$loginname = get_request_var('loginname');
$loginpass = get_request_var('loginpass');

if( $loginname == NULL || $loginpass == NULL )
{
  $appTemplate->addDefine("WARNING");
  $appTemplate->addReplacement("WARNINGMSG",$appTR->tr("You have to fill out all fields."));
}
else
{
  if( $appEngine->getAuthenticator() != NULL )
  {
    $u = new \svnadmin\core\entities\User;
    $u->id = $loginname;
    $u->name = $loginname;
  
    $authOK = $appEngine->getAuthenticator()->authenticate( $u, $loginpass );
    if( $authOK )
    {
      // Redirect to index page.
      $_SESSION["svnadmin_username"] = $loginname;
      header('Location: index.php');
    }
    else
    {
      $appTemplate->addDefine("ERROR");
      $appTemplate->addReplacement("ERRORMSG",$appTR->tr("Login failed."));
    }
  }
  else
  {
    // Authentication is deactivated!
    // ...
  }
}
?>
Return current item: iF.SVNAdmin