ea-Geiercode-base
[ class tree: ea-Geier ] [ index: ea-Geier ] [ all elements ]

Source for file newuser.inc.php

Documentation is available at newuser.inc.php

  1. <?php 
  2. /**
  3.  * php functions to create new users
  4.  *
  5.  * LICENSE:
  6.  * This program is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation; either version 2 of the License, or
  9.  * (at your option) any later version.
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.     See the
  13.  * GNU General Public License for more details.
  14.  * You should have received a copy of the GNU General Public License along
  15.  * with this program; if not, write to the Free Software Foundation, Inc.,
  16.  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17.  *
  18.  * @package       ea-Geier
  19.  * @subpackage code/base
  20.  * @author       m2mtech <tech@m2m.at>
  21.  * @copyright  2007 m2m server software gmbh
  22.  * @license       http://www.gnu.org/licenses/gpl.html GNU General Public License Version 2
  23.  * @version       $Id: newuser.inc.php 53 2007-04-17 06:32:57Z m2mtech $
  24.  * @link       http://www.ea-geier.at/
  25.  */
  26.  
  27. /**
  28.  * html functions for new user screen
  29.  */
  30. require_once('code/base/newuser.html.php');
  31.  
  32. /**
  33.  * generate data for html output of new-user screen
  34.  *
  35.  * @param    eaInput input data
  36.  */
  37. function genOptNewUser(&$in{
  38. }
  39.  
  40. /**
  41.  * saves new user data
  42.  *
  43.  * validates the input data and generates the new user
  44.  *
  45.  * @param    eaDB    database
  46.  * @param    eaInput input data
  47.  * @return    boolean status
  48.  */
  49. function saveNewUser(&$db&$in{
  50.  
  51.     if (!isset($_POST['buttonNewUser'])) return false;
  52.     
  53.     $vars array('p:txt:pass''p:mail:mail''p:txt:txt');
  54.     $in->check($vars);
  55.     
  56.     if ($in->errorreturn false// wrong input
  57.     
  58.     $data array()
  59.     $vars array('mail' => 'mail''pass' => 'pw''txtName' => 'name');
  60.     foreach ($vars as $key => $var{
  61.         if (isset($in->post[$key])) $data[$var$in->post[$key];
  62.         else $in->error[$keytrue;
  63.     }
  64.  
  65.     if ($in->errorreturn false// missing vars
  66.  
  67.     if ($db->isUser($data['mail'])) {
  68.         $in->error['userexists'true;
  69.         $in->error['mail'true;
  70.         return false;
  71.     }
  72.  
  73.     return $db->createUser($data);
  74. }
  75.         
  76. ?>

Documentation generated on Sun, 09 Sep 2007 17:09:10 +0200 by phpDocumentor 1.3.1