Source for file sendpw.inc.php
Documentation is available at sendpw.inc.php
* php functions to sent lost passwords
* 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: sendpw.inc.php 73 2007-05-22 22:11:29Z m2mtech $
* @link http://www.ea-geier.at/
* html functions for send-password screen
require_once('code/base/sendpw.html.php');
* mail functions for send-password screen
require_once('code/base/sendpw.mail.php');
* generate data for html output of send-password screen
* @param eaInput input data
* send new user password data
* validates the input data, generates new password and delivers it
* @param eaInput input data
if (!isset ($_POST['buttonSendPW'])) return false;
$vars = array('p:mail:mail');
if ($in->error) return false; // wrong input
if (!isset ($in->post['mail']) || !$name = $db->isUser($in->post['mail'])) {
$in->error['mail'] = true;
if (!$db->setPW($in->post['mail'], $pass)) return false;
if (!eaMailSendPW($conf, $name, $in->post['mail'], $pass)) {
$in->error['serverproblem'] = true;
* generate mnemnonic password
* @return string password
$cons = array('b', 'c' ,'d', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'r', 's', 't', 'v', 'w', 'x', 'z');
$vocal = array('a', 'e', 'i', 'o', 'u', 'y');
for($i = 0; $i < $len; $i++ )
$pass .= $cons[rand(0, 18)] . $vocal[rand(0,5)];
|