ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
NetVPOPMaild.php
Go to the documentation of this file.
1<?php
2/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
3
31require_once 'Auth/Container.php';
35require_once 'PEAR.php';
39require_once 'Net/Vpopmaild.php';
40
56{
57
62 var $server = 'localhost';
63
68 var $port = 89;
69
77 {
78 if (isset($server) && !is_null($server)) {
79 if (is_array($server)) {
80 if (isset($server['host'])) {
81 $this->server = $server['host'];
82 }
83 if (isset($server['port'])) {
84 $this->port = $server['port'];
85 }
86 } else {
87 if (strstr($server, ':')) {
88 $serverparts = explode(':', trim($server));
89 $this->server = $serverparts[0];
90 $this->port = $serverparts[1];
91 } else {
92 $this->server = $server;
93 }
94 }
95 }
96 }
97
108 function fetchData($username, $password)
109 {
110 $this->log('Auth_Container_Vpopmaild::fetchData() called.', AUTH_LOG_DEBUG);
111 $vpopmaild =& new Net_Vpopmaild();
112 // Connect
113 try {
114 $res = $vpopmaild->connect($this->server, $this->port, $this->method);
115 } catch (Net_Vpopmaild_FatalException $e) {
116 $this->log('Connection to Vpopmaild server failed.', AUTH_LOG_DEBUG);
117 return PEAR::raiseError($e->getMessage(), $e->getCode());
118 }
119 // Authenticate
120 try {
121 $result = $vpopmaild->clogin($username, $password);
122 $vpopmaild->quit();
123 } catch (Net_Vpopmaild_Exception $e) {
124 return PEAR::raiseError($e->getMessage(), $e->getCode());
125 }
126 return $result;
127 }
128}
129?>
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
Definition: Auth.php:59
$result
fetchData($username, $password)
fetchData()
Auth_Container_Vpopmaild($server=null)
Constructor of the container class.
log($message, $level=AUTH_LOG_DEBUG)
Log a message to the Auth log.
Definition: Container.php:246
& raiseError($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
This method is a wrapper that returns an instance of the configured error class with this object's de...
Definition: PEAR.php:524