Documentation is available at class.Input.inc
- <?php //-*-php-*-
- /* ******************************************************************** **
- ** Copyright notice **
- ** **
- ** (c) 1995-2003 PHPOpenChat Development Team **
- ** http://phpopenchat.sourceforge.net/ **
- ** **
- ** All rights reserved **
- ** **
- ** This script is part of the PHPOpenChat project. The PHPOpenChat **
- ** project 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. **
- ** **
- ** The GNU General Public License can be found at **
- ** http://www.gnu.org/copyleft/gpl.html. **
- ** A copy is found in the textfile GPL and important notices to the **
- ** license from the team is found in the textfile LICENSE distributed **
- ** with these scripts. **
- ** **
- ** This script is distributed in the hope that it will be useful, **
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of **
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
- ** GNU General Public License for more details. **
- ** **
- ** This copyright notice MUST APPEAR in all copies of the script! **
- ** ******************************************************************** */
- /**
- * Get default values
- */
- require_once(POC_BASE.'/config.inc.php');
- // require_once(POC_INCLUDE_PATH.'/class.Logger.inc');
- /**
- * Class Input holds everything posted by chatters
- * which *might* be valid
- *
- * @package phpopenchat
- * @author Juergen Jaeschke <jjaeschke@educat.hu-berlin.de>
- * @access public
- * @version $Id: class.Input.inc,v 1.2 2003/10/15 22:16:42 jjaeschke Exp $
- */
- class Input {
- var $errorcode=0;
- var $line = '';
- var $channel = CHANNEL_SELECTED;
- // var $recipient = '###EVERYBODY###';
- var $recipient = '';
- var $PHPSESSID = '';
- var $whispered = 'off';
- // var $unknown = array();
- /**
- * Constructor for class Input
- *
- * @param array $post HTTP POST
- */
- function Input ( $post ) {
- deb("entering input");
- if ( ! is_array ($post) ) {
- deb("post is not an array, help!");
- die ("post MUST be an array");
- }
- # set variables which are posted and remove from array
- # replace with get_class_vars later...
- reset($post);
- while ( !is_null($key = key($post)) ) {
- if ( isset ($this->$key) ) {
- $this->$key = $post[$key];
- // deb($key.":".$post[$key]."::".$this->$key );
- unset($post[$key]);
- reset($post);
- }
- else {
- // deb($key.":".$post[$key]."::".$this->$key );
- next($post);
- }
- }
- # anything left ?
- reset($post);
- while ( !is_null($key = key($post)) ) {
- $_SESSION['logger']->warning("unknown key in POST:$key=".$post[$key]);
- $errorcode|=1;
- next($post);
- }
- // $_SESSION['logger']->history_raw( $this );
- }
- function is_valid () {
- return ($errorcode & 1) ? false : true ;
- }
- function get_line () {
- return($this->line);
- }
- function get_channel () {
- return($this->channel);
- }
- function get_recipient() {
- return($this->recipient);
- }
- function get_PHPSESSID() {
- return($this->PHPSESSID);
- }
- function get_whispered() {
- return($this->whispered);
- }
- function get ( $key ) {
- $ret = '';
- if ( isset ( $this->post[$key] ) ) {
- return ( $this->post[$key] );
- }
- else {
- return (undef);
- }
- }
- // function _log () {
- // $_SESSION['logger']->history_raw("test");
- // }
- }
- ?>
Documentation generated on Tue, 29 Jun 2004 14:42:06 +0200 by phpDocumentor 1.3.0RC3