$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;
if (!empty($ff->Pman['local_autoauth']) &&
($ff->Pman['local_autoauth'] === true) &&
(!empty($_SERVER['SERVER_ADDR'])) &&
- ($_SERVER['SERVER_ADDR'] == '127.0.0.1') &&
- ($_SERVER['REMOTE_ADDR'] == '127.0.0.1')
+ (
+ (
+ $_SERVER['SERVER_ADDR'] == '127.0.0.1' &&
+ $_SERVER['REMOTE_ADDR'] == '127.0.0.1'
+ )
+ ||
+ (
+ $_SERVER['SERVER_ADDR'] == '::1' &&
+ $_SERVER['REMOTE_ADDR'] == '::1'
+ )
+ )
) {
$group = DB_DataObject::factory('core_group');
$group->get('name', 'Administrators');
if (!empty($ff->Pman['local_autoauth']) &&
(!empty($_SERVER['SERVER_ADDR'])) &&
- ($_SERVER['SERVER_ADDR'] == '127.0.0.1') &&
- ($_SERVER['REMOTE_ADDR'] == '127.0.0.1') &&
+ (
+ (
+ $_SERVER['SERVER_ADDR'] == '127.0.0.1' &&
+ $_SERVER['REMOTE_ADDR'] == '127.0.0.1'
+ )
+ ||
+ (
+ $_SERVER['SERVER_ADDR'] == '::1' &&
+ $_SERVER['REMOTE_ADDR'] == '::1'
+ )
+ ) &&
($default_admin || $u->get('email', $ff->Pman['local_autoauth']))
) {
$_SESSION[get_class($this)][$sesPrefix .'-auth'] = serialize($default_admin ? $default_admin : $u);
$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)
{
+ if (function_exists('pasword_hash')) {
+ return password_hash($value);
+ }
+
$salt='';
while(strlen($salt)<9) {
$salt.=chr(rand(64,126));
}
+ if(!empty($q['in_group_name'])){
+
+ $v = $this->escape($q['in_group_name']);
+
+ $this->whereAdd("
+ $tn_p.id IN (
+ SELECT
+ DISTINCT(user_id) FROM $tn_gm
+ LEFT JOIN
+ $tn_g
+ ON
+ $tn_g.id = $tn_gm.group_id
+ WHERE
+ $tn_g.name = '{$v}'
+ )"
+ );
+ }
+
// #2307 Search Country!!
if (!empty($q['query']['in_country'])) {
// DB_DataObject::debugLevel(1);
* this is called after checkPerm..
*/
- function beforeDelete()
+ function beforeDelete($dependants_array, $roo)
{
$e = DB_DataObject::Factory('Events');