Source for file newuser.inc.php
Documentation is available at newuser.inc.php
* php functions to create new users
* 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; either version 2 of the License, or
* (at your option) any later version.
* 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 not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* @author m2mtech <tech@m2m.at>
* @copyright 2007 m2m server software gmbh
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License Version 2
* @version $Id: newuser.inc.php 53 2007-04-17 06:32:57Z m2mtech $
* @link http://www.ea-geier.at/
* html functions for new user screen
require_once('code/base/newuser.html.php');
* generate data for html output of new-user screen
* @param eaInput input data
* validates the input data and generates the new user
* @param eaInput input data
if (!isset ($_POST['buttonNewUser'])) return false;
$vars = array('p:txt:pass', 'p:mail:mail', 'p:txt:txt');
if ($in->error) return false; // wrong input
$vars = array('mail' => 'mail', 'pass' => 'pw', 'txtName' => 'name');
foreach ($vars as $key => $var) {
if (isset ($in->post[$key])) $data[$var] = $in->post[$key];
else $in->error[$key] = true;
if ($in->error) return false; // missing vars
if ($db->isUser($data['mail'])) {
$in->error['userexists'] = true;
$in->error['mail'] = true;
return $db->createUser($data);
|