[dev] New IMSP Options
Michael Rubinsky
mike at theupstairsroom.com
Wed Apr 14 11:30:47 PDT 2004
The latest changes for the Net_IMSP package and associated files:
In Net_IMSP:
New class in file Options.php: Net_IMSP_Options - for storing
options/preferences to IMSP server.
General code cleanup (especially comments) and very small bug fixes.
In Prefs:
New concrete class in file imsp.php: Prefs_imsp - to allow preferences to
be stored using IMSP backend.
Thanks -
Mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Options.php
Type: application/octet-stream
Size: 6670 bytes
Desc: not available
Url : http://lists.horde.org/archives/dev/attachments/20040414/44635434/Options-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: imsp.php
Type: application/octet-stream
Size: 4660 bytes
Desc: not available
Url : http://lists.horde.org/archives/dev/attachments/20040414/44635434/imsp-0001.obj
-------------- next part --------------
Index: Prefs/package.xml===================================================================RCS file: /repository/framework/Prefs/package.xml,vretrieving revision 1.9diff -r1.9 package.xml39a40> <file name="imsp.php"/>47a49> <provides type="class" name="Prefs_imsp" />Index: Net_IMSP/IMSP.php===================================================================RCS file: /repository/framework/Net_IMSP/IMSP.php,vretrieving revision 1.10diff -r1.10 IMSP.php6a7,8> define('IMSP_OCTET_COUNT', "/({)([0-9]{1,})(\}$)/");> define('IMSP_MUST_USE_LITERAL', "/[^a-z0-9\s\-,]/i");24c26< * The Net_IMSP class provides a api into an IMSP server .---> * The Net_IMSP class provides a common interface to an IMSP server .32a35> * @version $Revision: 1.10 $37a41,44> /**> * String containing name/IP address of imsp host.> * @var string $imsp_server> */38a46,50> > /**> * String containing port for imsp server.> * @var string $imsp_port> */39a52,56> > /**> * Boolean to set if we should write to a log, if one is set up.> * @var boolean $logEnabled> */52a70,74> /**> * Constructor function.> *> * @access public> */69c91,92< * @return boolean true on success PEAR_Error on connection failure.---> * @access public> * @return mixed True on success PEAR_Error on connection failure.78c101,102< ---> $this->writeToLog('Initializing Net_IMSP object.', __FILE__, __LINE__, > PEAR_LOG_DEBUG);83a108,109> *> *@access public89d114< 103c128,129< * @return String containing raw capability response.---> * @access public> * @return string The raw capability response.134c160,161< * @return Boolean true on success PEAR_Error on failure---> * @access public> * @return mixed True on success PEAR_Error on failure.160,163c187,191< * @param $commandText String to send to the server.< * @param $includeTag Boolean determines if command tag is prepended.< * @param $sendCRLF Boolean determines if CRLF is appended.< * @return mixed true on success PEAR_Error on failure.---> * @access public> * @param string $commandText Text to send to the server.> * @param boolean $includeTag Determines if command tag is prepended.> * @param boolean $sendCRLF Determines if CRLF is appended.> * @return mixed True on success PEAR_Error on failure.174c202< $this->_tag = $this->getNextCommandTag();---> $this->_tag = $this->_getNextCommandTag();197c225,226< * @return mixed 'NO' 'BAD' 'OK' or raw response or PEAR_Error---> * @access public> * @return mixed 'NO', 'BAD', 'OK', raw response or PEAR_Error.214c243< __LINE__,PEAR_LOG_DEBUG);---> __LINE__, PEAR_LOG_DEBUG);256a286> * @access public271,272c301,303< * @parmam $length byte count to read from socket.< * @return String containing text of string literal.---> * @access public> * @param int $length Number of bytes to read from socket.> * @return string Text of string literal.276a308,309> $this->writeToLog('From{}: ' . $temp, __FILE__, > __LINE__, PEAR_LOG_DEBUG);283c316,317< * @return string containing next command tag.---> * @access private> * @return string Next command tag.285c319< function getNextCommandTag()---> function _getNextCommandTag()294a329> * @access public296c331< * @return string quoted if needed.---> * @return string Original string quoted if needed.314c349< * @param string $file File name where error occured---> * @param string $file File name where error occured.325c360< $this->writeToLog(_("$log_text"), $file, $line, PEAR_LOG_ERR); ---> $this->writeToLog($log_text, $file, $line, PEAR_LOG_ERR); 336,338c371,374< * Writes a message to the imsp log_file.< *< * @param $message string containing message to write.---> * Writes a message to the imsp logfile.> * > * @access public> * @param string $message Text to write.364,365c400,403< * @param $params array containing Log object parameters.< * @return boolean true on success / PEAR_Error on failure.---> * > * @access public> * @param array $params Log object parameters.> * @return mixed True on success or PEAR_Error on failure.380a419> 388a428,429> *> * @access private401a443> * Must be called as $imsp = &Net_IMSP::factory($driver, $params);403,405c445,448< * @param $driver string type of Net_IMSP object to return.< * @param $params mixed any parameters needed by the Net_IMSP object.< * @return the requested Net_IMSP object or PEAR_Error on failure.---> * @access public> * @param string $driver Type of Net_IMSP object to return.> * @param mixed $params Any parameters needed by the Net_IMSP object.> * @return mixed The requested Net_IMSP object or PEAR_Error on failure.427a471> * Must be called as $imsp = &Net_IMSP::singleton($driver, $params);429,431c473,475< * @param $driver string type of Net_IMSP object to return.< * @params $params mixed any parameters needed by the Net_IMSP object.< * @return reference to the Net_IMSP object or PEAR_Error on failure.---> * @param string $driver Type of Net_IMSP object to return.> * @params mixed $params Any parameters needed by the Net_IMSP object.> * @return mixed Reference to the Net_IMSP object or PEAR_Error on failure.Index: Net_IMSP/package.xml===================================================================RCS file: /repository/framework/Net_IMSP/package.xml,vretrieving revision 1.5diff -r1.5 package.xml29a30> <provides type="class" name="Net_IMSP_Options"/>40a42> <file name="Options.php"/>Index: Net_IMSP/IMSP/Auth.php===================================================================RCS file: /repository/framework/Net_IMSP/IMSP/Auth.php,vretrieving revision 1.6diff -r1.6 Auth.php14a15> * @version $Revision 1.5 $23,25c24,26< * @param $params mixed array parameters for Net_IMSP_Auth< * object. < * @param $login boolean Whether to remain logged in or not.---> * @access public> * @param array $params Parameters for Net_IMSP> * @param boolean $login Should we remain logged in after auth?53c54,55< * @param $params Parameters for Net_IMSP_Auth driver.---> * @access private> * @param array $params Parameters for Net_IMSP_Auth driver.61,67c63,70< /**< * Attempts to return a concrete Net_IMSP_Auth instance based on $driver< * Must be called as &Net_IMSP_Auth::factory()< *< * @param $driver string type of Net_IMSP_Auth subclass to return.< * @return The created Net_IMSP_Auth subclass or PEAR_Error on failure.< */---> /**> * Attempts to return a concrete Net_IMSP_Auth instance based on $driver> * Must be called as &Net_IMSP_Auth::factory()> *> * @access public> * @param string $driver Type of Net_IMSP_Auth subclass to return.> * @return mixed The created Net_IMSP_Auth subclass or PEAR_Error.> */95,96c98,99< * @param $driver string type of IMSP_Auth subclass to return.< * @return reference to IMSP_Auth subclass.---> * @param string $driver Type of IMSP_Auth subclass to return.> * @return object Reference to IMSP_Auth subclass.113d115< Index: Net_IMSP/IMSP/Book.php===================================================================RCS file: /repository/framework/Net_IMSP/IMSP/Book.php,vretrieving revision 1.11diff -r1.11 Book.php13,14d12< define('IMSP_OCTET_COUNT', "/({)([0-9]{1,})(\}$)/");< define('IMSP_MUST_USE_LITERAL', "/[^a-z0-9\s\-,]/i");40a39> * @version $Revision 1.10 $55d53< 59,62c57,58< * @param string $userId Username to login to IMSP server with.< * @param string $pass Password to use on IMSP server.< * @param string $imsp_server Address of IMSP server to login to.< * @param string $imsp_port Port to connect to if diff than default.---> * @param array $params Parameters needed for Net_IMSP (username, password, > * auth_method, server, port) 64,65d59< //function Net_IMSP_Book($userId, $pass, $auth_method, $imsp_server,< // $imsp_port = '')75c69,70< * @return boolean true on success PEAR_Error on failure.---> * @access public> * @return mixed True on success PEAR_Error on failure.87c82,83< $this->_imsp->writeToLog('Net_IMSP_Book initialized.');---> $this->_imsp->writeToLog('Net_IMSP_Book initialized.', __FILE__, > __LINE__, PEAR_LOG_DEBUG);96c92,93< * @return array of addressbook names or PEAR_Error on failure.---> * @access public> * @return mixed Array of addressbook names or PEAR_Error.140c137< return $this->_imsp->imspError(IMSP_EXIT_UNEXPECTED_RESPONSE,---> return $this->_imsp->imspError(IMSP_UNEXPECTED_RESPONSE,153,156c150,154< * @param $abook string containing addressbook name to search.< * @param $search string search criteria (may include * wild card).< * @param (optional) $search_field name of IMSP field to search on.< * @return mixed array of names of the entries that match or PEAR_Error.---> * @access public > * @param string $abook Addressbook name to search.> * @param string $search Search criteria (may include * wild card).> * @param optional string $search_field Name of IMSP field to search on.> * @return mixed Array of names of the entries that match or PEAR_Error.287,291c285,288< * If no matches are found, or there is an error, a false is returned.< *< * @param $abook string containing the name of the addressbook to search.< * @param $entryName string - 'name' attribute of the entry to retrieve< * @return mixed array containing entry or PEAR_Error on failure / no match.---> * @access public > * @param string $abook Name of the addressbook to search.> * @param string $entryName 'name' attribute of the entry to retrieve> * @return mixed Array containing entry or PEAR_Error on failure / no match.377,379c374,376< *< * @param $abookName string FULLY QUALIFIED name such 'jdoe.clients' etc...< * @return mixed true on success / PEAR_Error on failure---> * @access public> * @param string $abookName FULLY QUALIFIED name such 'jdoe.clients' etc...> * @return mixed True on success / PEAR_Error on failure.400c397< ---> 447c444,446< * @param $abookName name of addressbook to delete.---> *> * @access public> * @param string $abookName Name of addressbook to delete.515,517c514,518< * @param $abookOldName string old name< * @param $abookNewName string new addressbook name< * @return mixed true / PEAR_Error---> *> * @access public> * @param string $abookOldName Old name.> * @param string $abookNewName New addressbook name.> * @return mixed True / PEAR_Error587,590c588,592< * @param $abook string name of addressbook to add entry to< * @param array containing entry information.< * there MUST be a field 'name' containing the entry name.< * @return mixed true on success / PEAR_Error on failure.---> * @access public> * @param string $abook Name of addressbook to add entry to.> * @param array Addressbook entry information -> * there MUST be a field 'name' containing the entry name.> * @return mixed True on success / PEAR_Error on failure.721,723c723,727< * @param $abook string name of addressbook containing entry< * @param $bookEntry string name of entry to delete.< * @return mixed true on success / PEAR_Error on failure---> *> * @access public> * @param string $abook Name of addressbook containing entry.> * @param string $bookEntry Name of entry to delete.> * @return mixed True on success / PEAR_Error on failure.785,787c789,793< * Attempts to acquire a semephore on the addressbook entry< * @param $abook string addressbook name< * @param $bookEntry string name of entry to lock---> * Attempts to acquire a semephore on the addressbook entry.> *> * @access public> * @param string $abook Addressbook name> * @param string $bookEntry Name of entry to lock870,873c876,881< * Unlocks a previously locked abook.< * @param $abook string name of addressbook containing locked entry.< * @param $bookEntry string name of entry to unlock.< * @return mixed true on success, PEAR_Error on failure.---> * Unlocks a previously locked addressbook.> *> * @access public> * @param string $abook Name of addressbook containing locked entry.> * @param string $bookEntry Name of entry to unlock.> * @return mixed True on success, PEAR_Error on failure.953,956c961,966< * @param string $abook name of addressbook.< * @param string $ident name of user for this acl.< * @param string $acl the acl for this user/book.< * @return mixed true on success / PEAR_Error on failure.---> *> * @access public> * @param string $abook Name of addressbook.> * @param string $ident Name of user for this acl.> * @param string $acl acl for this user/book.> * @return mixed True on success / PEAR_Error on failure.1031c1041< * @param $abook string name of addressbook to retrieve acl for.---> * @param string $abook Name of addressbook to retrieve acl for.1115,1116c1125,1128< * @param string $abook name of the addressbook.< * @param string $ident name of entry to remove acl for.---> *> * @access public> * @param string $abook Name of the addressbook.> * @param string $ident Name of entry to remove acl for.1256,1257c1268,1269< * @param array containing log parameters.< * @return boolean true on success PEAR_Error on failure.---> * @param array Log parameters.> * @return mixed True on success PEAR_Error on failure.1270,1272c1282,1285< * @param string $server_response string containing the raw fetchaddress< * response from server.< * @return array containing then entry information---> *> * @access private> * @param string $server_response The raw fetchaddress response.> * @return array Addressbook entry information as key=>value pairs.Index: Net_IMSP/IMSP/Auth/cram_md5.php===================================================================RCS file: /repository/framework/Net_IMSP/IMSP/Auth/cram_md5.php,vretrieving revision 1.4diff -r1.4 cram_md5.php11a12> * @version $Revision 1.4 $21,22c22,23< * @param $params mixed array of parameters. Must contain:< * 'username', 'password', 'server', 'port'---> * @access private> * @param mixed $params To contain 'username', 'password', 'server', 'port'77a79> * @access private80d81< *Index: Net_IMSP/IMSP/Auth/plaintext.php===================================================================RCS file: /repository/framework/Net_IMSP/IMSP/Auth/plaintext.php,vretrieving revision 1.5diff -r1.5 plaintext.php11a12> * @version $Revision: 1.5 $21c22,23< * @param mixed $params parameters needed for authentication.---> * @access private> * @param mixed $params To contain 'username', 'password', 'server', 'port'.78c80< return $this->imspError(IMSP_NO_CONTINUATION_RESPONSE,---> return $imsp->imspError(IMSP_NO_CONTINUATION_RESPONSE,97c99< return $this->imspError(IMSP_EXIT_LOGIN_FAILED);---> return $imsp->imspError(IMSP_EXIT_LOGIN_FAILED,__FILE__,__LINE__);
More information about the dev
mailing list