2000-12-18 21:09:56 +01:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
|
|
|
* phpGroupWare *
|
|
|
|
* http://www.phpgroupware.org *
|
|
|
|
* -------------------------------------------- *
|
|
|
|
* This program is free software; you can redistribute it and/or modify it *
|
|
|
|
* under the terms of the GNU General Public License as published by the *
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
|
|
* option) any later version. *
|
|
|
|
\**************************************************************************/
|
|
|
|
|
|
|
|
/* $Id $ */
|
|
|
|
|
|
|
|
class auth
|
|
|
|
{
|
|
|
|
|
|
|
|
function authenticate($username, $passwd) {
|
|
|
|
global $phpgw_info, $phpgw;
|
|
|
|
error_reporting(error_reporting() - 2);
|
|
|
|
|
|
|
|
|
|
|
|
if ($phpgw_info["server"]["mail_login_type"] == "vmailmgr") {
|
|
|
|
$username = $username . "@" . $phpgw_info[server][mail_suffix];
|
|
|
|
}
|
|
|
|
if ($phpgw_info["server"]["mail_server_type"]=="imap") {
|
|
|
|
$phpgw_info["server"]["mail_port"] = "143";
|
|
|
|
} elseif ($phpgw_info["server"]["mail_server_type"]=="pop3") {
|
|
|
|
$phpgw_info["server"]["mail_port"] = "110";
|
|
|
|
}
|
|
|
|
|
|
|
|
$mailauth = imap_open("{".$phpgw_info["server"]["mail_server"]
|
|
|
|
.":".$phpgw_info["server"]["mail_port"]."}INBOX", $username , $passwd);
|
|
|
|
|
|
|
|
error_reporting(error_reporting() + 2);
|
|
|
|
if ($mailauth == False) {
|
|
|
|
return False;
|
|
|
|
} else {
|
|
|
|
imap_close($mailauth);
|
|
|
|
return True;
|
|
|
|
}
|
|
|
|
}
|
2001-01-04 21:20:43 +01:00
|
|
|
function change_password($old_passwd, $new_passwd) {
|
|
|
|
global $phpgw_info, $phpgw;
|
|
|
|
return $old_passwd;
|
|
|
|
}
|
2000-12-18 21:09:56 +01:00
|
|
|
}
|
|
|
|
?>
|