Joomla! Discussion Forums



It is currently Mon Nov 23, 2009 6:59 pm (All times are UTC )

 




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 349 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 12  Next
Author Message
Posted: Fri Dec 09, 2005 10:25 am 
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Fri Aug 19, 2005 8:22 am
Posts: 168
Hi.
I installed soap extension for VB but when trying test file I get sth like this

Parse error: syntax error, unexpected '{' in /home/virtualki/9887/forum/VB_SOAP/soap/examples/test.php on line 9

Any suggestions?


Top
   
 
Posted: Fri Dec 09, 2005 10:38 am 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Nov 02, 2005 11:20 am
Posts: 354
you can use only soap module ( and VB_SOAP extension ) only if you have php5 installed

php4 dont know try...catch construct and SoapClient/Server object

if you have php4 you should use vbulletin_sql module
it has nearly all funcationality what vbulletin module


Top
  E-mail  
 
Posted: Mon Dec 12, 2005 1:33 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Nov 02, 2005 11:20 am
Posts: 354
*update*

1. compatibility with JMSOAP addon
functions delete/store and the login in the mosUsers object will by called with second parameter
if this exists, code from com_connector will not be executed

this is needed, to better compatibility with JMSOAP addon

2. vbulletin module store cookies in the database correctly
the cookies will not be deleted more, until user klicks on logout


Top
  E-mail  
 
Posted: Mon Dec 12, 2005 6:13 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Oct 21, 2005 9:44 pm
Posts: 46
I would try this if I could log into my Joomla :(

VBridge upgrade and Joomla upgrade is stopping me from doing so :(

_________________
Join my thriving site with over 592 arcade games at GSNForce.com or you can also add me to your friends list on MySpace


Top
   
 
Posted: Mon Dec 12, 2005 8:11 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Nov 02, 2005 11:20 am
Posts: 354
GSN Masta wrote:
I would try this if I could log into my Joomla :(

VBridge upgrade and Joomla upgrade is stopping me from doing so :(


how do you mean that?

if you want to switch from vbridge to com_connector, you must follow the steps in the howto


Top
  E-mail  
 
Posted: Fri Dec 16, 2005 11:54 am 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Nov 02, 2005 11:20 am
Posts: 354
*update*

this is only bugfix update
if anyone use the vbulletin (soap) module and new version of VB_SOAP you must update to this version


for the way

vbulletin->joomla

you must install this addon on vbulletin side:

http://www.vbulletin.org/forum/showthre ... post849868

for more information: http://forum.joomla.org/index.php/topic,19447.0.html


Last edited by leonsio on Fri Dec 16, 2005 12:37 pm, edited 1 time in total.

Top
  E-mail  
 
Posted: Sat Dec 17, 2005 4:41 am 
Joomla! Intern
Joomla! Intern
Offline

Joined: Tue Oct 04, 2005 2:12 am
Posts: 87
I finally got it installed. Did not realize that I had to include the db info in the vbulletin_sql.class.php
However, while it allows for vb users to log in,

1-they don't log in forums
2-there is a brief error message when you log in
3-it does not add the salt value in jos_users

vb 3.51 and joomla 1.04


Last edited by Lionel on Sat Dec 17, 2005 5:23 am, edited 1 time in total.

Top
  E-mail  
 
Posted: Sat Dec 17, 2005 5:36 am 
Joomla! Intern
Joomla! Intern
Offline

Joined: Tue Oct 04, 2005 2:12 am
Posts: 87
This is the error I get briefly at login

Warning: func_get_arg(): Argument 0 not passed to function in /var/www/includes/joomla.php on line 783
Warning: func_get_arg(): Argument 1 not passed to function in /var/www/includes/joomla.php on line 783


Top
  E-mail  
 
Posted: Mon Dec 19, 2005 9:20 am 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Nov 02, 2005 11:20 am
Posts: 354
Lionel wrote:
I finally got it installed. Did not realize that I had to include the db info in the vbulletin_sql.class.php
However, while it allows for vb users to log in,

1-they don't log in forums
2-there is a brief error message when you log in
3-it does not add the salt value in jos_users

vb 3.51 and joomla 1.04


this is not an error, its a warning, i will fix it in new release
you dont need salt or other modification on joomla user table
if you are switching from vbridge to com_connector you should follow the howto ( in the first post )


Top
  E-mail  
 
Posted: Mon Dec 19, 2005 10:48 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Sep 12, 2005 2:29 pm
Posts: 32
with this is it possible to have the site use the joomla profile rather then the vbulletin profile? and then display fields / info from the vbulletin profile in the joomla profiles?


Top
  E-mail  
 
Posted: Tue Dec 20, 2005 3:44 am 
Joomla! Intern
Joomla! Intern
Offline

Joined: Fri Aug 19, 2005 10:30 pm
Posts: 73
does this work with phpbb?


Top
  E-mail  
 
Posted: Tue Dec 20, 2005 9:07 am 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Nov 02, 2005 11:20 am
Posts: 354
it works with phpbb

you must use the phpbb2_sql module

phpbb module supports usersynchronisation phpbb->joomla and common login

synchronisation joomla->phpbb and updating userdata dont work at the moment


@wordplay

with this component you can have a site where the users can login in joomla and vbulletin with the same username/password

as profile fields are only email/username/password supported, so if you change it in joomla, it would be changed in vbulletin


Top
  E-mail  
 
Posted: Fri Dec 23, 2005 10:36 am 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Nov 02, 2005 11:20 am
Posts: 354
new addon

http://forum.joomla.org/index.php/topic,26259.0.html

this module shows users logged in on vbulletin

works only with vbulletin  ( soap ) module

and needs version 1.0.7+ of VB_SOAP

version for vbulletin_sql module is not planed ;)

demo http://www.c4u.to


Top
  E-mail  
 
Posted: Fri Dec 23, 2005 10:56 am 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Mon Aug 29, 2005 5:17 pm
Posts: 297
Location: Austria
leonsio wrote:
it works with phpbb

you must use the phpbb2_sql module

phpbb module supports usersynchronisation phpbb->joomla and common login

synchronisation joomla->phpbb and updating userdata dont work at the moment


@wordplay

with this component you can have a site where the users can login in joomla and vbulletin with the same username/password

as profile fields are only email/username/password supported, so if you change it in joomla, it would be changed in vbulletin

synchronisation joomla->phpbb and updating userdata dont work at the moment
Will this be implement?
WIll this sync all joomla user to phpbb with joomala user_id?

Thnx

_________________
BosanskoHercegovacki Chat Komjuniti
http://www.chat.ba


Top
   
 
Posted: Fri Dec 23, 2005 12:12 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Nov 02, 2005 11:20 am
Posts: 354
crow wrote:
leonsio wrote:
it works with phpbb

you must use the phpbb2_sql module

phpbb module supports usersynchronisation phpbb->joomla and common login

synchronisation joomla->phpbb and updating userdata dont work at the moment


@wordplay

with this component you can have a site where the users can login in joomla and vbulletin with the same username/password

as profile fields are only email/username/password supported, so if you change it in joomla, it would be changed in vbulletin

synchronisation joomla->phpbb and updating userdata dont work at the moment
Will this be implement?
WIll this sync all joomla user to phpbb with joomala user_id?

Thnx



my favorite module is vbulletin
i have created the phpbb and wbblite modules as demos, anyone who wants can continue to develop then
the synchronisation works by username, not the userid, phpbb and joomla can have different IDs for the same user
only the username must be same


Top
  E-mail  
 
Posted: Thu Dec 29, 2005 2:53 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Dec 07, 2005 9:46 pm
Posts: 20
Lionel wrote:
This is the error I get briefly at login

Warning: func_get_arg(): Argument 0 not passed to function in /var/www/includes/joomla.php on line 783
Warning: func_get_arg(): Argument 1 not passed to function in /var/www/includes/joomla.php on line 783


I also have this problem. When I login it shows this before a redirect :S

It is just a different line number for me...

Quote:
Warning: func_get_arg(): Argument 0 not passed to function in /var/www/includes/joomla.php on line 724
Warning: func_get_arg(): Argument 1 not passed to function in /var/www/includes/joomla.php on line 724


Code on this line...
Code:
// COM_CONNECTOR by leonsio BEGIN
if(!func_get_arg(0) && !func_get_arg(1))
{


Last edited by Hailo on Thu Dec 29, 2005 3:00 am, edited 1 time in total.

Top
  E-mail  
 
Posted: Thu Dec 29, 2005 8:32 am 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Nov 02, 2005 11:20 am
Posts: 354
its only a warning, all should works without problems

i will fix this warnung next year ;)


Top
  E-mail  
 
Posted: Thu Dec 29, 2005 1:43 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Nov 02, 2005 11:20 am
Posts: 354
Hailo wrote:
Cool, I have commented out the lines giving the warnings for now.

Also I have done a vWar, see attached file.

I will look into the SMF as I like this forum and would prefer to use your method of syncronisation :D



cool, nice work, i will link the module in the first post ;)


Top
  E-mail  
 
Posted: Thu Dec 29, 2005 9:27 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Nov 02, 2005 11:20 am
Posts: 354
link added to the first post

great work

in the vbulletin_sql module you can see howto change userdata or delete users in the connected applications ;)


Top
  E-mail  
 
Posted: Fri Dec 30, 2005 3:23 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Dec 07, 2005 9:46 pm
Posts: 20
Thanks for the info on that, I have added these missing methods to both classes. Attached files updated on previous posts  ;)


Top
  E-mail  
 
Posted: Fri Dec 30, 2005 8:56 pm 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Thu Sep 15, 2005 6:04 pm
Posts: 263
Location: Little Rock, Arkansas
This thread has really been interesting.  Quick question.  I went in and a compare on both joomla.php's and cleaned up the diffs (the newer 1.05 -> patched older) except for the connector stuff.  Is this going to hose anything up?

Thanks,
Eric

_________________
Web Design, Hosting, Flash Development, Graphics & Logo Design
"The Web Made Easy"
http://www.web-jive.com


Top
  E-mail  
 
Posted: Fri Dec 30, 2005 10:20 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Dec 07, 2005 9:46 pm
Posts: 20
Think I found a problem on the "Remember Me" part of the login....

Code:
// unable to login with module, we now need to add or update the user record.
if($module->app_useradd)
{
   if($application->userset($username, $passwd, $row->email))
   {
      // re-call the login function in this class
      $this->login($username,$passwd);
      break;
   }
}


I changed the line "$this->login($username,$passwd);" from "$this->login();" and "mosGetParam( $_POST, 'passwd', '' )" too "$passwd". This makes sure the username and password is not lost when it re-calls the login function.

Note: This change "mosGetParam( $_POST, 'passwd', '' )" too "$passwd" means the password is already a md5 hash, some more changes will to be done to the com_connector to get this to work on this basis.

Let me know what you have in mind to deal with the "Remember Me" login functionality.


Last edited by Hailo on Fri Dec 30, 2005 10:29 pm, edited 1 time in total.

Top
  E-mail  
 
Posted: Fri Dec 30, 2005 10:29 pm 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Thu Sep 15, 2005 6:04 pm
Posts: 263
Location: Little Rock, Arkansas
There are a couple of places this is present in joomla.php.  Which one to replace?  Both?

Thanks

_________________
Web Design, Hosting, Flash Development, Graphics & Logo Design
"The Web Made Easy"
http://www.web-jive.com


Top
  E-mail  
 
Posted: Fri Dec 30, 2005 10:43 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Dec 07, 2005 9:46 pm
Posts: 20
Hailo wrote:
Note: This change "mosGetParam( $_POST, 'passwd', '' )" too "$passwd" means the password is already a md5 hash, some more changes will to be done to the com_connector to get this to work on this basis.


Well, dont replace it atm mate. Need to see what the com_connector author has in mind for this first.

The code I refer to is on the "function login( $username=null,$passwd=null )" in the loop "foreach ( $data as $module )". This is com_connector code.

The com_connector modules rely on the password being un-hashed and the "Remember Me" cookie stores the password in a md5 hash. This will fail the com_connector modules that need to have the un-hashed password to make its own hash for example.

I think it is possible to un-hash the md5 used on the joomla remember me cookie as it does not salt it and is basically only the orig password with md5. Well, lets see what leonsio has to say.

EDIT:

I have noticed that the autor is trying to use the variable "$lifetime" (if set) to force the cookies made by the com_connector classes have the same lifetime as the remember me cookie. So what would need to be done is to skip the com_connector login code if it detects the login as a "remember me" login type and the change to "$this->login($username,$passwd);" might also be needed in the com_connector loop.

OR

Detect if there is a joomla remember me cookie and then update the other cookies lifetime by reading the old cookie and re-creating it with a new "$lifetime".

This should stop the code...
Code:
<script> alert(\""._LOGIN_INCOMPLETE."\"); window.history.go(-1); </script>\n";


This javascript alert is what you will see when using the com_connector and the joomla remember me cookie together.


Last edited by Hailo on Fri Dec 30, 2005 11:18 pm, edited 1 time in total.

Top
  E-mail  
 
Posted: Sat Dec 31, 2005 2:57 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Dec 07, 2005 9:46 pm
Posts: 20
I just found a encrypt / decrypt php class...

Code:
<?php
class ENCRYPTION
{
var $KEY = "NEED_A_DECENT_KEY";

//Encrypt Function
function encrypt($string)
{
$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256,
MCRYPT_MODE_ECB), MCRYPT_RAND);
$passcrypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->KEY,
$string, MCRYPT_MODE_ECB, $iv);
$encoded = base64_encode($passcrypt);
return $encoded;
}

//Decrypt Function
function decrypt($string)
{
$decoded = base64_decode($string);
$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256,
MCRYPT_MODE_ECB), MCRYPT_RAND);
$decrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->KEY,
$decoded, MCRYPT_MODE_ECB, $iv);
return trim($decrypted);
}
}
?>


This could be used to store the password in the "remember me" cookie so the com_connector can then de-crypt the value and use this?

EDIT....

These are the changes I am going to try (don't know if it will work yet, but its worth a shot. USE THIS AT YOUR OWN RISK)...

com_connector - joomla.php changes...
Code:
<?php
/**
* Login validation function
*
* Username and encoded password is compare to db entries in the jos_users
* table. A successful validation updates the current session record with
* the users details.
*/
function login( $username=null,$passwd=null ) {
   global $acl;
   $encryption     = new encryption;
   $usercookie    = mosGetParam( $_COOKIE, 'usercookie', '' );
   $sessioncookie    = mosGetParam( $_COOKIE, 'sessioncookie', '' );
   // set clean password
   if (!$usercookie)
   {    
      $cleanpasswd=mosGetParam( $_POST, 'passwd', '' );
      $remember = mosGetParam( $_POST, 'remember', '' );
   }
   else
   {          
      $cleanpasswd=$encryption->decrypt($usercookie[md5($encryption->COOKIEKEY)]);
      $remember = "yes";
   }
   // deal with null username or password
   if (!$username || !$passwd) {
      $username    = mosGetParam( $_POST, 'username', '' );
      $passwd    = mosGetParam( $_POST, 'passwd', '' );
      $passwd    = md5( $passwd );
      $bypost    = 1;
   }
   /*echo "<script> alert(\"(Debug) username=".$username." passwd=".$passwd." cleanpasswd=".$cleanpasswd."\");</script>\n";*/
   if (!$username || !$passwd) {
      /*echo "<script> alert(\""._LOGIN_INCOMPLETE."\"); window.history.go(-1); </script>\n";*/
      $this->logout();
      exit();
   } else {
      $query = "SELECT *"
      . "\n FROM #__users"
      . "\n WHERE username = '$username'"
      . "\n AND password = '$passwd'"
      ;
      $this->_db->setQuery( $query );
      $row = null;
      if ($this->_db->loadObject( $row )) {
         if ($row->block == 1) {
            mosErrorAlert(_LOGIN_BLOCKED);
         }
         // fudge the group stuff
         $grp = $acl->getAroGroup( $row->id );
         $row->gid = 1;

         if ($acl->is_group_child_of( $grp->name, 'Registered', 'ARO' ) ||
         $acl->is_group_child_of( $grp->name, 'Public Backend', 'ARO' )) {
            // fudge Authors, Editors, Publishers and Super Administrators into the Special Group
            $row->gid = 2;
         }
         $row->usertype = $grp->name;

         $session =& $this->_session;
         $session->guest       = 0;
         $session->username       = $username;
         $session->userid       = intval( $row->id );
         $session->usertype       = $row->usertype;
         $session->gid          = intval( $row->gid );

         $session->update();

         $currentDate = date("Y-m-d\TH:i:s");
         $query = "UPDATE #__users"
         . "\n SET lastvisitDate = '$currentDate'"
         . "\n WHERE id = $session->userid"
         ;
         $this->_db->setQuery($query);
         if (!$this->_db->query()) {
            die($this->_db->stderr(true));
         }

         if ($remember=="yes") {
            $lifetime = time() + 365*24*60*60;
            setcookie( "usercookie[username]", $username, $lifetime, "/" );
            setcookie( "usercookie[password]", $passwd, $lifetime, "/" );
            setcookie( "usercookie[".md5($encryption->COOKIEKEY)."]", $encryption->encrypt($cleanpasswd), $lifetime, "/" );               
         }
         // COM_CONNECTOR by leonsio BEGIN
         //echo("<br>BEGIN COM_CONNECTOR");
         //if(!func_get_arg(0) && !func_get_arg(1))
         //{
            $query ="   SELECT *       "
            ."\n      FROM #__connectors   "
            ."\n      WHERE published=1   ";
            $this->_db->setQuery($query);
            $data = $this->_db->loadObjectList();
            $cookies=array();
            foreach ( $data as $module )
            {
               // include module
               require_once("./components/com_connector/modules/$module->module.class.php");
               // module init
               $params=new mosParameters($module->params);
               $application=new $module->module($params, $module->id);
                                 
               // try to login with module
               if($application->login($username, $cleanpasswd))
               {
                  // cookies
                  $cookies[$module->id]=$application->getcookies();
                  // session cookies
                  foreach( $cookies[$module->id] AS $name => $value)
                  {
                        //echo("<br>name=".$name." value[0]=".$value[0]);
                        setcookie($name, $value[0], $lifetime, $value[1]);
                  }
               }
               else
               {
                  // unable to login with module, we now need to add or update the user record.
                  if($module->app_useradd)
                  {
                     if($application->userset($username, $cleanpasswd, $row->email))
                     {
                        // re-call the login function in this class
                        $this->login($username,$passwd);
                        break;
                     }
                  }
               }
            //}
            //echo("<br>END COM_CONNECTOR");
            
            // Cookies in die Datenbank speichern ( werden beim logout geloescht )
                           $query = "UPDATE #__users"
                           . "\n SET connector_cookies = '".serialize($cookies)."'"
                           . "\n WHERE id = $session->userid"
                           ;
                           $this->_db->setQuery($query);
                           if (!$this->_db->query()) {
                                    die($this->_db->stderr(true));
                           }
         }

         // COM_CONNECTOR by leonsio END

         //mosCache::cleanCache('com_content');
         mosCache::cleanCache();
      } else {
                     // COM_CONNECTOR by leonsio BEGIN
         //if(!func_get_arg(0) && !func_get_arg(1))
         //{   
                        $query ="       SELECT *                "
                        ."\n            FROM #__connectors      "
                        ."\n            WHERE published=1       ";
                        $this->_db->setQuery($query);
                        $data = $this->_db->loadObjectList();
                        foreach ( $data as $module )
                        {
                              // Passendes Modul laden
                              require_once("./components/com_connector/modules/$module->module.class.php");
                              //Modul initalisieren
               $params=new mosParameters($module->params);
                              $application=new $module->module($params, $module->id);
                              // Benutzer einlogen
                              if($application->login($username, $cleanpasswd) && $module->jos_useradd)
                              {
                  if($module->jos_useradd)
                  {
                     $useradded=false;
                     // Benutzerdaten hollen
                     if($application->userget($application->__userdata->userid))
                     {
                        $error=0;
                        $userdata=$application->__userdata;
                        // Registration..
                                       $newuser                = new mosUser( $this->_db );
                                       $newuser->id            = 0;
                                       $newuser->usertype      = '';
                                       $newuser->gid           = $acl->get_group_id( 'Registered', 'ARO' );
                                       $newuser->email         = $userdata->email;
                                       $newuser->name          = $userdata->name;
                                       $newuser->username      = $userdata->username;

                                       if (!$newuser->check())
                                       {
                           $error++;
                                       }   

                                       $newuser->password      = $passwd;
                                       $newuser->registerDate  = date('Y-m-d H:i:s', $userdata->joindate);

                                       if (!$newuser->store(0,1))
                                       {
                           $error++;
                                       }

                                       $newuser->checkin();

                        if($error != 0 )
                           $newuser->delete($newuser->id, 1);
                        else
                        {
                           $useradded=true;
                           break;
                        }
                     }
                  }
                              }       
                                    
                        } 
            if(!$useradded)
            {
               if (isset($bypost)) {
                  mosErrorAlert(_LOGIN_INCORRECT);
               } else {
                  $this->logout();
                  mosRedirect("index.php");
               }
               exit();
            }
            else
            {
               $this->login();
            }
         //}
         // COM_CONNECTOR by leonsio END
      }
   }
}
/**
* User logout
*
* Reverts the current session record back to 'anonymous' parameters
*/
function logout() {
   //mosCache::cleanCache('com_content');
   mosCache::cleanCache();
         $session =& $this->_session;


         // COM_CONNECTOR by leonsio BEGIN
    $userid=$session->userid;
         $query ="       SELECT *                "
         ."\n            FROM #__connectors      "
         ."\n            WHERE published=1       ";
         $this->_db->setQuery($query);
         $data = $this->_db->loadObjectList();
         $cookies=array();
         foreach ( $data as $module )
         {
               // Passendes Modul laden
               require_once("./components/com_connector/modules/$module->module.class.php");
               //Modul initialisieren
               $params=new mosParameters($module->params);
               $application=new $module->module($params, $module->id);

               // Benutzer auslogen
               $application->logout();
         }
         $query = "UPDATE #__users"
         . "\n SET connector_cookies = ''"
         . "\n WHERE id = $userid"
         ;
         $this->_db->setQuery($query);
         if (!$this->_db->query())
            die($this->_db->stderr(true));
         // COM_CONNECTOR by leonsio END


   $session->guest       = 1;
   $session->username       = '';
   $session->userid       = '';
   $session->usertype       = '';
   $session->gid = 0;

   $session->update();

   // this is daggy??
   $lifetime   = time() - 1800;
   $encryption = new encryption;
   
   setcookie( "usercookie[username]", " ", $lifetime, "/" );
   setcookie( "usercookie[password]", " ", $lifetime, "/" );
   setcookie( "usercookie[".md5($encryption->COOKIEKEY)."]", " ", $lifetime, "/" );   
   setcookie( "usercookie", " ", $lifetime, "/" );
   @session_destroy();
}
?>


class encryption - add this into the above file or in an include.
Code:
<?php
class encryption
{
   var $KEY       = "NEED_A_DECENT_KEY";
   var $COOKIEKEY = "NEED_A_DECENT_KEY";
   
   //Encrypt Function
   function encrypt($string)
   {
      $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256,
      MCRYPT_MODE_ECB), MCRYPT_RAND);
      $passcrypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->KEY,
      $string, MCRYPT_MODE_ECB, $iv);
      $encoded = base64_encode($passcrypt);
      return $encoded;
   }
   
   //Decrypt Function
   function decrypt($string)
   {
      $decoded = base64_decode($string);
      $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256,
      MCRYPT_MODE_ECB), MCRYPT_RAND);
      $decrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->KEY,
      $decoded, MCRYPT_MODE_ECB, $iv);
      return trim($decrypted);
   }
}
?>


Replace "NEED_A_DECENT_KEY" with something from here: http://www.andrewscompanies.com/tools/wep.asp


Last edited by Hailo on Fri Jan 13, 2006 10:47 am, edited 1 time in total.

Top
  E-mail  
 
Posted: Sat Dec 31, 2005 6:26 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Dec 07, 2005 9:46 pm
Posts: 20
Currently testing this on my site, I have placed the "class encryption" into a include file on my site, as I intend to add other classes to my site for vWar etc...

Added the line...
Code:
<?php
require_once( $mosConfig_absolute_path . '/includes/custom.class.php' );
?>

Under...
Code:
<?php
require_once( $mosConfig_absolute_path . '/includes/version.php' );
require_once( $mosConfig_absolute_path . '/includes/database.php' );
require_once( $mosConfig_absolute_path . '/includes/gacl.class.php' );
require_once( $mosConfig_absolute_path . '/includes/gacl_api.class.php' );
require_once( $mosConfig_absolute_path . '/includes/phpmailer/class.phpmailer.php' );
require_once( $mosConfig_absolute_path . '/includes/joomla.xml.php' );
require_once( $mosConfig_absolute_path . '/includes/phpInputFilter/class.inputfilter.php' );
require_once( $mosConfig_absolute_path . '/includes/custom.class.php' );
?>


/includes/custom.class.php - (ignore the "class mainFunctions" I wote this for using one joomla site for multipule sites)...
Code:
<?php
// Initialise
$_MAINFUNCTIONS = new mainFunctions();

//---------------------------------------------- Classes -----------------------------------------------------
class mainFunctions {

   function getsiteid()
   {
      // get siteswitcher cookie
      $siteswitchercookie = mosGetParam( $_COOKIE, 'siteswitcher', null );
      // set default siteid
      $language = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
      $defaultsiteid = strstr(strtoupper($language), strtoupper("en-us"));
      if (!$defaultsiteid) { $defaultsiteid="EU"; } else { $defaultsiteid="US"; }
      // check siteswitcher cookie exists
      if(!$siteswitchercookie)
      {
         setcookie("siteswitcher", $defaultsiteid,(time()+365*24*60*60));
         return $defaultsiteid;
      }
      else
      {
         setcookie("siteswitcher", $siteswitchercookie,(time()+365*24*60*60));
         return $siteswitchercookie;
      }
   }
   
   function checksiteid($siteid=null)
   {
      // get the stored siteid
      $storedsiteid = $this->getsiteid();
      // check the passed siteid
      if (!$siteid)
      {
         return true;
      }
      else
      {
         // compare the passed siteid to the stored siteid
         if (strtoupper($siteid)==strtoupper($storedsiteid)){ return true; } else { return false; }
      }
   }
   
}
//------------------------------------------------------------------------------------------------------------
class encryption
{
   var $KEY       = "NEED_A_DECENT_KEY";
   var $COOKIEKEY = "NEED_A_DECENT_KEY";
   
   //Encrypt Function
   function encrypt($string)
   {
      $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256,
      MCRYPT_MODE_ECB), MCRYPT_RAND);
      $passcrypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->KEY,
      $string, MCRYPT_MODE_ECB, $iv);
      $encoded = base64_encode($passcrypt);
      return $encoded;
   }
   
   //Decrypt Function
   function decrypt($string)
   {
      $decoded = base64_decode($string);
      $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256,
      MCRYPT_MODE_ECB), MCRYPT_RAND);
      $decrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->KEY,
      $decoded, MCRYPT_MODE_ECB, $iv);
      return trim($decrypted);
   }
}
//------------------------------------------------------------------------------------------------------------
?>


Last edited by Hailo on Fri Jan 13, 2006 10:48 am, edited 1 time in total.

Top
  E-mail  
 
Posted: Wed Jan 04, 2006 9:05 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Nov 09, 2005 4:57 pm
Posts: 38
does anyone have the method to use this for SMF or 4images?  ???
Thanks


Top
  E-mail  
 
Posted: Wed Jan 04, 2006 9:29 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Dec 07, 2005 9:46 pm
Posts: 20
I made a plugin for com_connector to handle SMF & vWar. The files are attached to posts in this topic (see 1st post for links).

You can see it working at http://www.totaldamage.org


Top
  E-mail  
 
Posted: Wed Jan 04, 2006 9:37 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Nov 09, 2005 4:57 pm
Posts: 38
wow nice.... now can anyone do 4images please??  :-[


Top
  E-mail  
 
Posted: Sun Jan 08, 2006 1:52 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Nov 02, 2005 11:20 am
Posts: 354
next week i will release little tutorial to patch joomla.php himself
and updated code for joomla 1.0.5

some bugs will be fixed too


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 349 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 12  Next

Quick reply

 



Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group