Spade

Mini Shell

Directory:~$ /home/lmsyaran/public_html/joomla4/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ /home/lmsyaran/public_html/joomla4/email.tar

email.php000064400000004203151157155020006345 0ustar00<?php

/**
 * @version		$Id: email.php 20196 2011-03-04 02:40:25Z mrichey $
 * @package		plg_auth_email
 * @copyright	Copyright (C) 2005 - 2011 Michael Richey. All rights
reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */
// No direct access
defined('_JEXEC') or die;

jimport('joomla.plugin.plugin');

class plgAuthenticationEmail extends JPlugin {

    /**
     * This method should handle any authentication and report back to the
subject
     */
    function onUserAuthenticate(&$credentials, $options,
&$response) {


        // Get a database object
        $db = JFactory::getDbo();
        $query = $db->getQuery(true);

        $query->select('u.id, username, password');
       
$query->from($db->quoteName('#__users','u'));
       
$query->join('inner',$db->quoteName('#__reservation_consultant','co')
.'on
('.$db->quoteName('co.userid').'='.$db->quoteName('u.id').')'
);
        $query->where(
$db->quoteName('co.phonenumber').'='.$db->Quote($credentials['username']));

        $db->setQuery($query);
        $result = $db->loadObject();
        if (empty($result))
        {
            $db = JFactory::getDbo();
            $query = $db->getQuery(true);

            $query->select('u.id, username, password');
           
$query->from($db->quoteName('#__users','u'));
           
$query->join('inner',$db->quoteName('#__reservation_sick','s')
.'on
('.$db->quoteName('s.userid').'='.$db->quoteName('u.id').')'
);
            $query->where(
$db->quoteName('s.phoneNumber').'='.$db->Quote($credentials['username']));

            $db->setQuery($query);
            $result = $db->loadObject();
        }


        if ($result) {
            // why mess with re-creating authentication - just use the
system.
            $credentials['username'] = $result->username;
            require_once JPATH_PLUGINS .
'/authentication/joomla/joomla.php';
            PlgAuthenticationJoomla::onUserAuthenticate($credentials,
$options, $response);
        } else {
            $response->status = JAuthentication::STATUS_FAILURE;
            $response->error_message =
JText::_('JGLOBAL_AUTH_INVALID_PASS');            
        }
    }

}
email.xml000064400000001600151157155020006354 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin"
group="authentication" method="upgrade">
	<name>plg_authentication_email</name>
	<author>Michael Richey</author>
	<creationDate>March 2011</creationDate>
	<copyright>Copyright (C) 2005 - 2011 Michael Richey. All rights
reserved.</copyright>
	<license>GNU General Public License version 2 or later; see
LICENSE.txt</license>
	<authorEmail>authemail@richeyweb.com</authorEmail>
	<authorUrl>www.richeyweb.com</authorUrl>
	<version>2.3.1</version>
	<description>PLG_AUTH_EMAIL_XML_DESCRIPTION</description>
	<files>
		<filename plugin="email">email.php</filename>
		<filename>index.html</filename>
	</files>
	<languages folder="language">
		<language
tag="en-GB">en-GB/en-GB.plg_authentication_email.ini</language>
		<language
tag="en-GB">en-GB/en-GB.plg_authentication_email.sys.ini</language>
	</languages>
</extension>
index.html000064400000000035151157155020006541 0ustar00<html>
<body>
</body>
</html>