mtheoryx / iuwpcas

Wordpress plugin integrating Indiana University CAS Authentication
http://mtheoryx.github.com/iuwpcas
9 stars 5 forks source link

PHP 5.4 compatibility #12

Open joraff opened 10 years ago

joraff commented 10 years ago

I have a fork of this plugin in use at our university, and an upgrade to php 5.5 was causing the passwords not to be set for new users by the check_passwords callback. PHP 5.4 deprecated call-time pass-by-reference, and reference call must now be in the function definition.

I've modified my fork too much for a pull request, but just adding reference flags for $pass1 and $pass2 was enough.

function check_passwords( $user, &$pass1, &$pass2 ) {
    $random_password = substr( md5( uniqid( microtime( ))), 0, 8 );
    $pass1=$pass2=$random_password;
}