$decoder = new Mail_mimeDecode($mailtext);
$parts = $decoder->getSendArray();
- if (PEAR::isError($parts)) {
+ if (is_a($parts,'PEAR_Error')) {
return $parts;
//echo "PROBLEM: {$parts->message}";
//exit;
$u->whereAdd(' LENGTH(passwd) > 0');
$n = $u->count();
$_SESSION[get_class($this)][$sesPrefix .'-empty'] = $n;
- $error = PEAR::getStaticProperty('DB_DataObject','lastError');
- if ($error) {
- die($error->toString()); // not really a good thing to do...
+ if (class_exists('PEAR')) {
+ $error = PEAR::getStaticProperty('DB_DataObject','lastError');
+ if ($error) {
+ die($error->toString()); // not really a good thing to do...
+ }
}
if (!$n){ // authenticated as there are no users in the system...
return true;
function checkPassword($val)
{
+
if (substr($this->passwd,0,1) == '$') {
-
+ if (function_exists('pasword_verify')) {
+ return password_verify($val, $this->passwd);
+ }
return crypt($val,$this->passwd) == $this->passwd ;
}
// old style md5 passwords...- cant be used with courier....
function setPassword($value)
{
-
- return password_hash($value)
+ if (function_exists('pasword_hash')) {
+ return password_hash($value);
+ }
$salt='';
while(strlen($salt)<9) {