0

Hi I am currently using a PHP application which i access through a joomla site through an iframe.

The idea is to get this working with single sign on, which words just fine.

This is the code I have that takes the users password from my own php application and then encodes it to joomla hash

//encrypt password for joomla format
$salt = "";
if ($values["password"])
{
    $password = $values["password"];
    for ($i=0; $i<=32; $i++) 
        {
            $d=rand(1,30)%2;
            $salt .= $d ? chr(rand(65,90)) : chr(rand(48,57));
        } 
    $hashed = md5($password . $salt); $encrypted = $hashed . ':' . $salt;

Again this code works just fine, and I later pass it into an insert query.

The problem I am having is when I try to change the password of logged in user from my iframe application, I cant get it to update the joomla user table.

The variables available to me in this particular process are $oldpassword and $newpassword.

Could someone please help me get this working

  • possible duplicate of [Single sign on My joomla site and jobportal (jammit jobs) on same domain?](http://stackoverflow.com/questions/12474559/single-sign-on-my-joomla-site-and-jobportal-jammit-jobs-on-same-domain) – Sheepy Feb 08 '15 at 16:49
  • no its not, but i do need someone to tell me whats wrong with my concat here $sql = "update zzz_users set password = "'".$encrypted."' where username = '".$email."'"; CustomQuery($sql); – Jonathan Green Feb 08 '15 at 17:18
  • I don't think it is even correct string syntax, there is one too many double quote. It's very basic PHP, that may be out of scope for stackoverflow, better revisit PHP tutorials. – Sheepy Feb 09 '15 at 02:09

0 Answers0