joomla password encryption

前端 未结 9 1792
借酒劲吻你
借酒劲吻你 2020-11-27 14:13

I need to access the joomla user table jos_users for login checking from external php script [codeignitor].

joomla storing password like this

         


        
9条回答
  •  情深已故
    2020-11-27 14:32

    In joomla standard you can create password using the following way

                         jimport('joomla.user.helper');
                 $salt = JUserHelper::genRandomPassword(32);
                 $crypt = JUserHelper::getCryptedPassword($password_choose, $salt);
                 $password = $crypt.':'.$salt;
    

    you mention that you are accessing from external file(or programs) then if you have joomla installation on other side you can access it from outside the joomla structure.

    using joomla default frame work like this

    define( '_JEXEC', 1 );
    define('JPATH_BASE', dirname(__FILE__) );//this is when we are in the root
    define( 'DS', DIRECTORY_SEPARATOR );
    
    require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
    require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
    
    $mainframe =& JFactory::getApplication('site');
    $mainframe->initialise();
    

提交回复
热议问题