Sindbad~EG File Manager

Current Path : /var/www/web3/modules/core/classes/helpers/
Upload File :
Current File : /var/www/web3/modules/core/classes/helpers/UserRecoverPasswordHelper_simple.class

<?php
/*
 * Gallery - a web based photo album viewer and editor
 * Copyright (C) 2000-2007 Bharat Mediratta
 *
 * 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.
 */

/**
 * Utilities used in the UserRecoverPassword* controllers
 * @package GalleryCore
 * @subpackage Helpers
 * @author Jay Rossiter <cryptographite@users.sf.net>
 * @version $Revision: 15513 $
 * @static
 */
class UserRecoverPasswordHelper_simple {

    /**
     * Get the request expiration for the UserPasswordRequest from the database.
     * If authString is empty, only search by username
     *
     * @param string $username
     * @param string $authString authorization string (null acceptable)
     * @return array object GalleryStatus a status code
     *               int epoch-based request expiration
     */
    function getRequestExpires($username, $authString) {
	$searchParams['userName'] = $username;

	if (!empty($authString)) {
	    $searchParams['authString'] = $authString;
	}

	list ($ret, $searchResults) = GalleryCoreApi::getMapEntry('GalleryRecoverPasswordMap',
	    array('requestExpires'), $searchParams);
	if ($ret) {
	    return array($ret, null);
	}

	if ($request = $searchResults->nextResult()) {
	    $requestExpires = (int)$request[0];
	} else {
	    $requestExpires = null;
	}

	return array(null, $requestExpires);
    }

    /**
     * Get the request authString from the database.
     *
     * @param string $username
     * @return array object GalleryStatus a status code
     *               string authString
     */
    function getAuthString($username) {
	list ($ret, $searchResults) = GalleryCoreApi::getMapEntry('GalleryRecoverPasswordMap',
	    array('authString'), array('userName' => $username));
	if ($ret) {
	    return array($ret, null);
	}

	if ($request = $searchResults->nextResult()) {
	    $authString = $request[0];
	} else {
	    $authString = null;
	}

	return array(null, $authString);
    }
}
?>

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists