[X2serv-cvs] [CVS] Module x2: Change committed
Brought to you by:
sirvulcan
From: Alex S. <ru...@us...> - 2005-06-06 22:29:11
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2005-06-06 22:28:44 UTC Added files: tools/com_cservice/README tools/com_cservice/config.php tools/com_cservice/cservice.php tools/com_cservice/mysqldump.sql tools/com_cservice/regex.php tools/com_cservice/classes/ircclient.php tools/com_cservice/classes/template.php tools/com_cservice/help/errInvalidChannelName.html tools/com_cservice/help/errInvalidEmailDomain.html tools/com_cservice/help/errInvalidOwnerEmail.html tools/com_cservice/help/errInvalidOwnerHandle.html tools/com_cservice/help/errInvalidOwnerPassword.html tools/com_cservice/help/helpdocs.js tools/com_cservice/lang/en.php tools/com_cservice/templates/aup.html tools/com_cservice/templates/dberror.html tools/com_cservice/templates/must_login.html tools/com_cservice/templates/regfailed.html tools/com_cservice/templates/regsuccess.html tools/com_cservice/templates/too_many.html Log message: adding mambo web registration module to tools/ ---------------------- diff included ---------------------- Index: x2/tools/com_cservice/README diff -u /dev/null x2/tools/com_cservice/README:1.1 --- /dev/null Mon Jun 6 15:28:44 2005 +++ x2/tools/com_cservice/README Mon Jun 6 15:28:33 2005 @@ -0,0 +1,5 @@ +This is a MAMBO OPENSOURCE module for registering channels on a mambo based website with X2. + +It works for us, and im providing it so you can see how we did it. If your not really good with mysql, irc, and php, dont bother trying to get this to go.. its really a manual process for experts. (sorry) + + Index: x2/tools/com_cservice/classes/ircclient.php diff -u /dev/null x2/tools/com_cservice/classes/ircclient.php:1.1 --- /dev/null Mon Jun 6 15:28:44 2005 +++ x2/tools/com_cservice/classes/ircclient.php Mon Jun 6 15:28:33 2005 @@ -0,0 +1,145 @@ +<?php +class IRCClient +{ + var $irc_nick; + var $irc_user; + var $irc_name; + var $irc_host; + var $irc_server; + var $irc_port; + var $irc_password; + + var $socket; + var $error; + var $errno; + var $callback_handlers; + var $fp; + + function IRCClient ($nick, $user, $name, $host) + { + $this->irc_nick = $nick; + $this->irc_user = $user; + $this->irc_name = $name; + $this->irc_host = $host; + $this->socket = NULL; + $this->error = NULL; + $this->errno = NULL; + $this->callback_handlers = array(); + } + + function irc_connect ($server, $pass=NULL) + { + $this->fp = fopen ('/tmp/irclog.log', 'a'); + + list ($server, $port) = explode(':', $server); + $this->irc_server = $server; + $this->irc_port = ($port)? $port: '6667'; + $this->irc_pass = ($pass)? $pass: NULL; + + fwrite($this->fp, sprintf( "[%s] Connecting to %s (%s) port %s\n", + date("YmdHis"), $this->irc_server, + gethostbyname($this->irc_server), $this->irc_port ) ); + + $this->socket = fsockopen ($this->irc_server, $this->irc_port, + $this->errno, $this->error, 10); + + set_socket_blocking($this->socket, FALSE); + if ( !empty ($this->irc_password) ) { + $this->irc_send_msg (sprintf ("PASS %s", $this->irc_password)); + } + + $this->irc_send_msg (sprintf ("USER %s %s %s :%s", $this->irc_user, $this->irc_user, $this->irc_user, $this->irc_name)); + $this->irc_send_msg (sprintf ("NICK %s", $this->irc_nick)); + + + $this->irc_do_loop(); + } + + function irc_disconnect () + { + $this->irc_send_msg (sprintf ("QUIT")); + fclose ($this->socket); + $this->socket = NULL; + + fwrite($this->fp, sprintf( "[%s] Disconnected from %s (%s) port %s\n", + date("YmdHis"), $this->irc_server, + gethostbyname($this->irc_server), $this->irc_port ) ); + fclose ($this->fp); + } + + function irc_do_loop () + { + $begin_time = time(); + $bigbuf = ''; + while (1) + { + $bufr = fgets ($this->socket, 1024); + /* If this big has a end of line feed in it, we want to process it. + * if not, its just a partial, save it and try again */ + if(preg_match('/[\n]$/', $bufr)) + { + $bufr = $bigbuf . $bufr; + $bigbuf = ''; + fwrite($this->fp, sprintf( "[%s] %s", date("YmdHis"), $bufr)); + + $data = explode (' ', rtrim ($bufr), 4); + for ($i = 0; $i < count ($data); $i++) + { + $data[$i] = ltrim ($data[$i], ':'); + } + + if ( $data[0] == 'PING' ) { + $this->irc_send_msg (sprintf ("PONG %s", $data[1]), FALSE); + continue; + } + + if ( array_key_exists ($data[1], $this->callback_handlers) ) + { + if($this->callback_handlers[$data[1]] ( $data, $this ) == FALSE) + { + break; + } + } + } + else + { + $bigbuf = $bufr; + fwrite($this->fp, sprintf( "[%s] %s\n", date("YmdHis"), "No data yet, sleeping..")); + fflush($this->fp); + sleep(2); + } + if(time() - $begin_time > 60) + { + if(array_key_exists('timeout', $this->callback_handlers)) + { + set_time_limit(30); // dont time out php + $begin_time = time(); + if($this->callback_handlers['timeout'] (null, $this) == FALSE) + { + break; + } + } + } + } + } + + function irc_register_callback ($event, $callback) + { + $this->callback_handlers[$event] = $callback; + } + + function irc_unregister_callback ($event) + { + $this->callback_handlers[$event] = NULL; + } + + function irc_send_msg ($msg) + { + set_socket_blocking($this->socket, TRUE); + fwrite($this->fp, sprintf( "[%s] %s\n", date("YmdHis"), $msg)); + fputs ($this->socket, sprintf ("%s\n", $msg)); + set_socket_blocking($this->socket, FALSE); + + } +} +?> Index: x2/tools/com_cservice/classes/template.php diff -u /dev/null x2/tools/com_cservice/classes/template.php:1.1 --- /dev/null Mon Jun 6 15:28:44 2005 +++ x2/tools/com_cservice/classes/template.php Mon Jun 6 15:28:33 2005 @@ -0,0 +1,967 @@ +<?php +/* + * Session Management for PHP3 + * + * (C) Copyright 1999-2000 NetUSE GmbH + * Kristian Koehntopp + * + * $Id: template.php,v 1.1 2005/06/06 22:28:33 rubin Exp $ + * + */ + +/* + * Change log since version 7.2c + * + * Bug fixes to version 7.2c compiled by Richard Archer <rh...@ju...>: + * (credits given to first person to post a diff to phplib mailing list) + * + * Normalised all comments and whitespace (rha) + * replaced "$handle" with "$varname" and "$h" with "$v" throughout (from phplib-devel) + * added braces around all one-line if statements in: get_undefined, loadfile and halt (rha) + * set_var was missing two sets of braces (rha) + * added a couple of "return true" statements (rha) + * set_unknowns had "keep" as default instead of "remove" (from phplib-devel) + * set_file failed to check for empty strings if passed an array of filenames (phplib-devel) + * remove @ from call to preg_replace in subst -- report errors if there are any (NickM) + * set_block unnecessarily required a newline in the template file (Marc Tardif) + * pparse now calls this->finish to replace undefined vars (Layne Weathers) + * get_var now checks for unset varnames (NickM & rha) + * get_var when passed an array used the array key instead of the value (rha) + * get_vars now uses a call to get_var rather than this->varvals to prevent undefined var warning (rha) + * in finish, the replacement string referenced an unset variable (rha) + * loadfile would try to load a file if the varval had been set to "" (rha) + * in get_undefined, only match non-whitespace in variable tags as in finish (Layne Weathers & rha) + * more elegant fix to the problem of subst stripping '$n', '\n' and '\\' strings (rha) + * + * + * Changes in functionality which go beyond bug fixes: + * + * changed debug handling so set, get and internals can be tracked separately (rha) + * added debug statements throughout to track most function calls (rha) + * debug output contained raw HTML -- is now escaped with htmlentities (rha) + * Alter regex in set_block to remove more whitespace around BEGIN/END tags to improve HTML layout (rha) + * Add "append" option to set_var, works just like append in parse (dale at linuxwebpro.com, rha) + * Altered parse so that append is honored if passed an array (Brian) + * Converted comments and documentation to phpdoc style (rha) + * Added clear_var to set the value of variables to "" (rha) + * Added unset_var to usset variables (rha) + * + */ + +/** + * The template class allows you to keep your HTML code in some external files + * which are completely free of PHP code, but contain replacement fields. + * The class provides you with functions which can fill in the replacement fields + * with arbitrary strings. These strings can become very large, e.g. entire tables. + * + * Note: If you think that this is like FastTemplates, read carefully. It isn't. + * + */ + +class Template +{ + /** + * Serialization helper, the name of this class. + * + * @var string + * @access public + */ + var $classname = "Template"; + + /** + * Determines how much debugging output Template will produce. + * This is a bitwise mask of available debug levels: + * 0 = no debugging + * 1 = debug variable assignments + * 2 = debug calls to get variable + * 4 = debug internals (outputs all function calls with parameters). + * + * Note: setting $this->debug = true will enable debugging of variable + * assignments only which is the same behaviour as versions up to release 7.2d. + * + * @var int + * @access public + */ + var $debug = false; + + /** + * The base directory from which template files are loaded. + * + * @var string + * @access private + * @see set_root + */ + var $root = "components/com_cservice"; + + /** + * A hash of strings forming a translation table which translates variable names + * into names of files containing the variable content. + * $file[varname] = "filename"; + * + * @var array + * @access private + * @see set_file + */ + var $file = array(); + + /** + * A hash of strings forming a translation table which translates variable names + * into regular expressions for themselves. + * $varkeys[varname] = "/varname/" + * + * @var array + * @access private + * @see set_var + */ + var $varkeys = array(); + + /** + * A hash of strings forming a translation table which translates variable names + * into values for their respective varkeys. + * $varvals[varname] = "value" + * + * @var array + * @access private + * @see set_var + */ + var $varvals = array(); + + /** + * Determines how to output variable tags with no assigned value in templates. + * + * @var string + * @access private + * @see set_unknowns + */ + var $unknowns = "remove"; + + /** + * Determines how Template handles error conditions. + * "yes" = the error is reported, then execution is halted + * "report" = the error is reported, then execution continues by returning "false" + * "no" = errors are silently ignored, and execution resumes reporting "false" + * + * @var string + * @access public + * @see halt + */ + var $halt_on_error = "yes"; + + /** + * The last error message is retained in this variable. + * + * @var string + * @access public + * @see halt + */ + var $last_error = ""; + + /****************************************************************************** + * Class constructor. May be called with two optional parameters. + * The first parameter sets the template directory the second parameter + * sets the policy regarding handling of unknown variables. + * + * usage: Template([string $root = "."], [string $unknowns = "remove"]) + * + * @param $root path to template directory + * @param $string what to do with undefined variables + * @see set_root + * @see set_unknowns + * @access public + * @return void + */ + function Template($root = null, $unknowns = "remove") { + if($root == null) + $root = $this->root; + if ($this->debug & 4) { + echo "<p><b>Template:</b> root = $root, unknowns = $unknowns</p>\n"; + } + $this->set_root($root); + $this->set_unknowns($unknowns); + } + + + /****************************************************************************** + * Checks that $root is a valid directory and if so sets this directory as the + * base directory from which templates are loaded by storing the value in + * $this->root. Relative filenames are prepended with the path in $this->root. + * + * Returns true on success, false on error. + * + * usage: set_root(string $root) + * + * @param $root string containing new template directory + * @see root + * @access public + * @return boolean + */ + function set_root($root) { + if ($this->debug & 4) { + echo "<p><b>set_root:</b> root = $root</p>\n"; + } + if (!is_dir($root)) { + $this->halt("set_root: $root is not a directory."); + return false; + } + + $this->root = $root; + return true; + } + + + /****************************************************************************** + * Sets the policy for dealing with unresolved variable names. + * + * unknowns defines what to do with undefined template variables + * "remove" = remove undefined variables + * "comment" = replace undefined variables with comments + * "keep" = keep undefined variables + * + * Note: "comment" can cause unexpected results when the variable tag is embedded + * inside an HTML tag, for example a tag which is expected to be replaced with a URL. + * + * usage: set_unknowns(string $unknowns) + * + * @param $unknowns new value for unknowns + * @see unknowns + * @access public + * @return void + */ + function set_unknowns($unknowns = "remove") { + if ($this->debug & 4) { + echo "<p><b>unknowns:</b> unknowns = $unknowns</p>\n"; + } + $this->unknowns = $unknowns; + } + + + /****************************************************************************** + * Defines a filename for the initial value of a variable. + * + * It may be passed either a varname and a file name as two strings or + * a hash of strings with the key being the varname and the value + * being the file name. + * + * The new mappings are stored in the array $this->file. + * The files are not loaded yet, but only when needed. + * + * Returns true on success, false on error. + * + * usage: set_file(array $filelist = (string $varname => string $filename)) + * or + * usage: set_file(string $varname, string $filename) + * + * @param $varname either a string containing a varname or a hash of varname/file name pairs. + * @param $filename if varname is a string this is the filename otherwise filename is not required + * @access public + * @return boolean + */ + function set_file($varname, $filename = "") { + if (!is_array($varname)) { + if ($this->debug & 4) { + echo "<p><b>set_file:</b> (with scalar) varname = $varname, filename = $filename</p>\n"; + } + if ($filename == "") { + $this->halt("set_file: For varname $varname filename is empty."); + return false; + } + $this->file[$varname] = $this->filename($filename); + } else { + reset($varname); + while(list($v, $f) = each($varname)) { + if ($this->debug & 4) { + echo "<p><b>set_file:</b> (with array) varname = $v, filename = $f</p>\n"; + } + if ($f == "") { + $this->halt("set_file: For varname $v filename is empty."); + return false; + } + $this->file[$v] = $this->filename($f); + } + } + return true; + } + + + /****************************************************************************** + * A variable $parent may contain a variable block defined by: + * <!-- BEGIN $varname --> content <!-- END $varname -->. This function removes + * that block from $parent and replaces it with a variable reference named $name. + * The block is inserted into the varkeys and varvals hashes. If $name is + * omitted, it is assumed to be the same as $varname. + * + * Blocks may be nested but care must be taken to extract the blocks in order + * from the innermost block to the outermost block. + * + * Returns true on success, false on error. + * + * usage: set_block(string $parent, string $varname, [string $name = ""]) + * + * @param $parent a string containing the name of the parent variable + * @param $varname a string containing the name of the block to be extracted + * @param $name the name of the variable in which to store the block + * @access public + * @return boolean + */ + function set_block($parent, $varname, $name = "") { + if ($this->debug & 4) { + echo "<p><b>set_block:</b> parent = $parent, varname = $varname, name = $name</p>\n"; + } + if (!$this->loadfile($parent)) { + $this->halt("set_block: unable to load $parent."); + return false; + } + if ($name == "") { + $name = $varname; + } + + $str = $this->get_var($parent); + $reg = "/[ \t]*<!--\s+BEGIN $varname\s+-->\s*?\n?(\s*.*?\n?)\s*<!--\s+END $varname\s+-->\s*?\n?/sm"; + preg_match_all($reg, $str, $m); + $str = preg_replace($reg, "{" . "$name}", $str); + $this->set_var($varname, $m[1][0]); + $this->set_var($parent, $str); + return true; + } + + + /****************************************************************************** + * This functions sets the value of a variable. + * + * It may be called with either a varname and a value as two strings or an + * an associative array with the key being the varname and the value being + * the new variable value. + * + * The function inserts the new value of the variable into the $varkeys and + * $varvals hashes. It is not necessary for a variable to exist in these hashes + * before calling this function. + * + * An optional third parameter allows the value for each varname to be appended + * to the existing variable instead of replacing it. The default is to replace. + * This feature was introduced after the 7.2d release. + * + * + * usage: set_var(string $varname, [string $value = ""], [boolean $append = false]) + * or + * usage: set_var(array $varname = (string $varname => string $value), [mixed $dummy_var], [boolean $append = false]) + * + * @param $varname either a string containing a varname or a hash of varname/value pairs. + * @param $value if $varname is a string this contains the new value for the variable otherwise this parameter is ignored + * @param $append if true, the value is appended to the variable's existing value + * @access public + * @return void + */ + function set_var($varname, $value = "", $append = false) { + if (!is_array($varname)) { + if (!empty($varname)) { + if ($this->debug & 1) { + printf("<b>set_var:</b> (with scalar) <b>%s</b> = '%s'<br>\n", $varname, htmlentities($value)); + } + $this->varkeys[$varname] = "/".$this->varname($varname)."/"; + if ($append && isset($this->varvals[$varname])) { + $this->varvals[$varname] .= $value; + } else { + $this->varvals[$varname] = $value; + } + } + } else { + reset($varname); + while(list($k, $v) = each($varname)) { + if (!empty($k)) { + if ($this->debug & 1) { + printf("<b>set_var:</b> (with array) <b>%s</b> = '%s'<br>\n", $k, htmlentities($v)); + } + $this->varkeys[$k] = "/".$this->varname($k)."/"; + if ($append && isset($this->varvals[$k])) { + $this->varvals[$k] .= $v; + } else { + $this->varvals[$k] = $v; + } + } + } + } + } + + + /****************************************************************************** + * This functions clears the value of a variable. + * + * It may be called with either a varname as a string or an array with the + * values being the varnames to be cleared. + * + * The function sets the value of the variable in the $varkeys and $varvals + * hashes to "". It is not necessary for a variable to exist in these hashes + * before calling this function. + * + * + * usage: clear_var(string $varname) + * or + * usage: clear_var(array $varname = (string $varname)) + * + * @param $varname either a string containing a varname or an array of varnames. + * @access public + * @return void + */ + function clear_var($varname) { + if (!is_array($varname)) { + if (!empty($varname)) { + if ($this->debug & 1) { + printf("<b>clear_var:</b> (with scalar) <b>%s</b><br>\n", $varname); + } + $this->set_var($varname, ""); + } + } else { + reset($varname); + while(list($k, $v) = each($varname)) { + if (!empty($v)) { + if ($this->debug & 1) { + printf("<b>clear_var:</b> (with array) <b>%s</b><br>\n", $v); + } + $this->set_var($v, ""); + } + } + } + } + + + /****************************************************************************** + * This functions unsets a variable completely. + * + * It may be called with either a varname as a string or an array with the + * values being the varnames to be cleared. + * + * The function removes the variable from the $varkeys and $varvals hashes. + * It is not necessary for a variable to exist in these hashes before calling + * this function. + * + * + * usage: unset_var(string $varname) + * or + * usage: unset_var(array $varname = (string $varname)) + * + * @param $varname either a string containing a varname or an array of varnames. + * @access public + * @return void + */ + function unset_var($varname) { + if (!is_array($varname)) { + if (!empty($varname)) { + if ($this->debug & 1) { + printf("<b>unset_var:</b> (with scalar) <b>%s</b><br>\n", $varname); + } + unset($this->varkeys[$varname]); + unset($this->varvals[$varname]); + } + } else { + reset($varname); + while(list($k, $v) = each($varname)) { + if (!empty($v)) { + if ($this->debug & 1) { + printf("<b>unset_var:</b> (with array) <b>%s</b><br>\n", $v); + } + unset($this->varkeys[$v]); + unset($this->varvals[$v]); + } + } + } + } + + + /****************************************************************************** + * This function fills in all the variables contained within the variable named + * $varname. The resulting value is returned as the function result and the + * original value of the variable varname is not changed. The resulting string + * is not "finished", that is, the unresolved variable name policy has not been + * applied yet. + * + * Returns: the value of the variable $varname with all variables substituted. + * + * usage: subst(string $varname) + * + * @param $varname the name of the variable within which variables are to be substituted + * @access public + * @return string + */ + function subst($varname) { + $varvals_quoted = array(); + if ($this->debug & 4) { + echo "<p><b>subst:</b> varname = $varname</p>\n"; + } + if (!$this->loadfile($varname)) { + $this->halt("subst: unable to load $varname."); + return false; + } + + // quote the replacement strings to prevent bogus stripping of special chars + reset($this->varvals); + while(list($k, $v) = each($this->varvals)) { + $varvals_quoted[$k] = preg_replace(array('/\\\\/', '/\$/'), array('\\\\\\\\', '\\\\$'), $v); + } + + $str = $this->get_var($varname); + $str = preg_replace($this->varkeys, $varvals_quoted, $str); + return $str; + } + + + /****************************************************************************** + * This is shorthand for print $this->subst($varname). See subst for further + * details. + * + * Returns: always returns false. + * + * usage: psubst(string $varname) + * + * @param $varname the name of the variable within which variables are to be substituted + * @access public + * @return false + * @see subst + */ + function psubst($varname) { + if ($this->debug & 4) { + echo "<p><b>psubst:</b> varname = $varname</p>\n"; + } + print $this->subst($varname); + + return false; + } + + + /****************************************************************************** + * The function substitutes the values of all defined variables in the variable + * named $varname and stores or appends the result in the variable named $target. + * + * It may be called with either a target and a varname as two strings or a + * target as a string and an array of variable names in varname. + * + * The function inserts the new value of the variable into the $varkeys and + * $varvals hashes. It is not necessary for a variable to exist in these hashes + * before calling this function. + * + * An optional third parameter allows the value for each varname to be appended + * to the existing target variable instead of replacing it. The default is to + * replace. + * + * If $target and $varname are both strings, the substituted value of the + * variable $varname is inserted into or appended to $target. + * + * If $handle is an array of variable names the variables named by $handle are + * sequentially substituted and the result of each substitution step is + * inserted into or appended to in $target. The resulting substitution is + * available in the variable named by $target, as is each intermediate step + * for the next $varname in sequence. Note that while it is possible, it + * is only rarely desirable to call this function with an array of varnames + * and with $append = true. This append feature was introduced after the 7.2d + * release. + * + * Returns: the last value assigned to $target. + * + * usage: parse(string $target, string $varname, [boolean $append]) + * or + * usage: parse(string $target, array $varname = (string $varname), [boolean $append]) + * + * @param $target a string containing the name of the variable into which substituted $varnames are to be stored + * @param $varname if a string, the name the name of the variable to substitute or if an array a list of variables to be substituted + * @param $append if true, the substituted variables are appended to $target otherwise the existing value of $target is replaced + * @access public + * @return string + * @see subst + */ + function parse($target, $varname, $append = false) { + if (!is_array($varname)) { + if ($this->debug & 4) { + echo "<p><b>parse:</b> (with scalar) target = $target, varname = $varname, append = $append</p>\n"; + } + $str = $this->subst($varname); + if ($append) { + $this->set_var($target, $this->get_var($target) . $str); + } else { + $this->set_var($target, $str); + } + } else { + reset($varname); + while(list($i, $v) = each($varname)) { + if ($this->debug & 4) { + echo "<p><b>parse:</b> (with array) target = $target, i = $i, varname = $v, append = $append</p>\n"; + } + $str = $this->subst($v); + if ($append) { + $this->set_var($target, $this->get_var($target) . $str); + } else { + $this->set_var($target, $str); + } + } + } + + if ($this->debug & 4) { + echo "<p><b>parse:</b> completed</p>\n"; + } + return $str; + } + + + /****************************************************************************** + * This is shorthand for print $this->parse(...) and is functionally identical. + * See parse for further details. + * + * Returns: always returns false. + * + * usage: pparse(string $target, string $varname, [boolean $append]) + * or + * usage: pparse(string $target, array $varname = (string $varname), [boolean $append]) + * + * @param $target a string containing the name of the variable into which substituted $varnames are to be stored + * @param $varname if a string, the name the name of the variable to substitute or if an array a list of variables to be substituted + * @param $append if true, the substituted variables are appended to $target otherwise the existing value of $target is replaced + * @access public + * @return false + * @see parse + */ + function pparse($target, $varname, $append = false) { + if ($this->debug & 4) { + echo "<p><b>pparse:</b> passing parameters to parse...</p>\n"; + } + print $this->finish($this->parse($target, $varname, $append)); + return false; + } + + + /****************************************************************************** + * This function returns an associative array of all defined variables with the + * name as the key and the value of the variable as the value. + * + * This is mostly useful for debugging. Also note that $this->debug can be used + * to echo all variable assignments as they occur and to trace execution. + * + * Returns: a hash of all defined variable values keyed by their names. + * + * usage: get_vars() + * + * @access public + * @return array + * @see $debug + */ + function get_vars() { + if ($this->debug & 4) { + echo "<p><b>get_vars:</b> constructing array of vars...</p>\n"; + } + reset($this->varkeys); + while(list($k, $v) = each($this->varkeys)) { + $result[$k] = $this->get_var($k); + } + return $result; + } + + + /****************************************************************************** + * This function returns the value of the variable named by $varname. + * If $varname references a file and that file has not been loaded yet, the + * variable will be reported as empty. + * + * When called with an array of variable names this function will return a a + * hash of variable values keyed by their names. + * + * Returns: a string or an array containing the value of $varname. + * + * usage: get_var(string $varname) + * or + * usage: get_var(array $varname) + * + * @param $varname if a string, the name the name of the variable to get the value of, or if an array a list of variables to return the value of + * @access public + * @return string or array + */ + function get_var($varname) { + if (!is_array($varname)) { + if (isset($this->varvals[$varname])) { + $str = $this->varvals[$varname]; + } else { + $str = ""; + } + if ($this->debug & 2) { + printf ("<b>get_var</b> (with scalar) <b>%s</b> = '%s'<br>\n", $varname, htmlentities($str)); + } + return $str; + } else { + reset($varname); + while(list($k, $v) = each($varname)) { + if (isset($this->varvals[$v])) { + $str = $this->varvals[$v]; + } else { + $str = ""; + } + if ($this->debug & 2) { + printf ("<b>get_var:</b> (with array) <b>%s</b> = '%s'<br>\n", $v, htmlentities($str)); + } + $result[$v] = $str; + } + return $result; + } + } + + + /****************************************************************************** + * This function returns a hash of unresolved variable names in $varname, keyed + * by their names (that is, the hash has the form $a[$name] = $name). + * + * Returns: a hash of varname/varname pairs or false on error. + * + * usage: get_undefined(string $varname) + * + * @param $varname a string containing the name the name of the variable to scan for unresolved variables + * @access public + * @return array + */ + function get_undefined($varname) { + if ($this->debug & 4) { + echo "<p><b>get_undefined:</b> varname = $varname</p>\n"; + } + if (!$this->loadfile($varname)) { + $this->halt("get_undefined: unable to load $varname."); + return false; + } + + preg_match_all("/{([^ \t\r\n}]+)}/", $this->get_var($varname), $m); + $m = $m[1]; + if (!is_array($m)) { + return false; + } + + reset($m); + while(list($k, $v) = each($m)) { + if (!isset($this->varkeys[$v])) { + if ($this->debug & 4) { + echo "<p><b>get_undefined:</b> undefined: $v</p>\n"; + } + $result[$v] = $v; + } + } + + if (count($result)) { + return $result; + } else { + return false; + } + } + + + /****************************************************************************** + * This function returns the finished version of $str. That is, the policy + * regarding unresolved variable names will be applied to $str. + * + * Returns: a finished string derived from $str and $this->unknowns. + * + * usage: finish(string $str) + * + * @param $str a string to which to apply the unresolved variable policy + * @access public + * @return string + * @see set_unknowns + */ + function finish($str) { + switch ($this->unknowns) { + case "keep": + break; + + case "remove": + $str = preg_replace('/{[^ \t\r\n}]+}/', "", $str); + break; + + case "comment": + $str = preg_replace('/{([^ \t\r\n}]+)}/', "<!-- Template variable \\1 undefined -->", $str); + break; + } + + return $str; + } + + + /****************************************************************************** + * This function prints the finished version of the value of the variable named + * by $varname. That is, the policy regarding unresolved variable names will be + * applied to the variable $varname then it will be printed. + * + * usage: p(string $varname) + * + * @param $varname a string containing the name of the variable to finish and print + * @access public + * @return void + * @see set_unknowns + * @see finish + */ + function p($varname) { + print $this->finish($this->get_var($varname)); + } + + + /****************************************************************************** + * This function returns the finished version of the value of the variable named + * by $varname. That is, the policy regarding unresolved variable names will be + * applied to the variable $varname and the result returned. + * + * Returns: a finished string derived from the variable $varname. + * + * usage: get(string $varname) + * + * @param $varname a string containing the name of the variable to finish + * @access public + * @return void + * @see set_unknowns + * @see finish + */ + function get($varname) { + return $this->finish($this->get_var($varname)); + } + + + /****************************************************************************** + * When called with a relative pathname, this function will return the pathname + * with $this->root prepended. Absolute pathnames are returned unchanged. + * + * Returns: a string containing an absolute pathname. + * + * usage: filename(string $filename) + * + * @param $filename a string containing a filename + * @access private + * @return string + * @see set_root + */ + function filename($filename) { + if ($this->debug & 4) { + echo "<p><b>filename:</b> filename = $filename</p>\n"; + } + if (substr($filename, 0, 1) != "/") { + $filename = $this->root."/".$filename; + } + + if (!file_exists($filename)) { + $this->halt("filename: file $filename does not exist."); + } + return $filename; + } + + + /****************************************************************************** + * This function will construct a regexp for a given variable name with any + * special chars quoted. + * + * Returns: a string containing an escaped variable name. + * + * usage: varname(string $varname) + * + * @param $varname a string containing a variable name + * @access private + * @return string + */ + function varname($varname) { + return preg_quote("{".$varname."}"); + } + + + /****************************************************************************** + * If a variable's value is undefined and the variable has a filename stored in + * $this->file[$varname] then the backing file will be loaded and the file's + * contents will be assigned as the variable's value. + * + * Note that the behaviour of this function changed slightly after the 7.2d + * release. Where previously a variable was reloaded from file if the value + * was empty, now this is not done. This allows a variable to be loaded then + * set to "", and also prevents attempts to load empty variables. Files are + * now only loaded if $this->varvals[$varname] is unset. + * + * Returns: true on success, false on error. + * + * usage: loadfile(string $varname) + * + * @param $varname a string containing the name of a variable to load + * @access private + * @return boolean + * @see set_file + */ + function loadfile($varname) { + if ($this->debug & 4) { + echo "<p><b>loadfile:</b> varname = $varname</p>\n"; + } + + if (!isset($this->file[$varname])) { + // $varname does not reference a file so return + if ($this->debug & 4) { + echo "<p><b>loadfile:</b> varname $varname does not reference a file</p>\n"; + } + return true; + } + + if (isset($this->varvals[$varname])) { + // will only be unset if varname was created with set_file and has never been loaded + // $varname has already been loaded so return + if ($this->debug & 4) { + echo "<p><b>loadfile:</b> varname $varname is already loaded</p>\n"; + } + return true; + } + $filename = $this->file[$varname]; + + /* use @file here to avoid leaking filesystem information if there is an error */ + $str = implode("", @file($filename)); + if (empty($str)) { + $this->halt("loadfile: While loading $varname, $filename does not exist or is empty."); + return false; + } + + if ($this->debug & 4) { + printf("<b>loadfile:</b> loaded $filename into $varname<br>\n"); + } + $this->set_var($varname, $str); + + return true; + } + + + /****************************************************************************** + * This function is called whenever an error occurs and will handle the error + * according to the policy defined in $this->halt_on_error. Additionally the + * error message will be saved in $this->last_error. + * + * Returns: always returns false. + * + * usage: halt(string $msg) + * + * @param $msg a string containing an error message + * @access private + * @return void + * @see $halt_on_error + */ + function halt($msg) { + $this->last_error = $msg; + + if ($this->halt_on_error != "no") { + $this->haltmsg($msg); + } + + if ($this->halt_on_error == "yes") { + die("<b>Halted.</b>"); + } + + return false; + } + + + /****************************************************************************** + * This function prints an error message. + * It can be overridden by your subclass of Template. It will be called with an + * error message to display. + * + * usage: haltmsg(string $msg) + * + * @param $msg a string containing the error message to display + * @access public + * @return void + * @see halt + */ + function haltmsg($msg) { + printf("<b>Template Error:</b> %s<br>\n", $msg); + } + +} +?> Index: x2/tools/com_cservice/config.php diff -u /dev/null x2/tools/com_cservice/config.php:1.1 --- /dev/null Mon Jun 6 15:28:44 2005 +++ x2/tools/com_cservice/config.php Mon Jun 6 15:28:33 2005 @@ -0,0 +1,35 @@ +<?php +$irc_nick = 'regbot'; +$irc_user = 'regbot'; +$irc_name = 'X2 Web Link'; +// your webservers host. is ignored by irc server anyway.. +$irc_host = '127.0.0.1'; +// Your irc server and port +$irc_server = '127.0.0.1:6667'; +// Nick of your x2 service +$irc_botnick = 'X2'; +// NOTE. If you are another customer on this machine reading +// this file with php or cgi scripts please know that +// if you use this password to oper without autorization +// I will hunt you down and kill you. +// this is not an idle threat. Keep out of here, i mean it. +$irc_oper = 'oper oname opassword'; + +// Mysql info (used to store rate info and log signups) +$db_server = 'localhost'; +$db_port = ''; +$db_user = 'dbuser'; +$db_pass = 'dbpass'; +$db_database = 'dbname'; +$db_table = 'chanreg'; + +/* $my comes from mambo.. */ +$channel_name = ''; +$channel_owner_handle = $my->userid; +$channel_owner_email = $my->email; +$channel_owner_password = ''; +$channel_default_modes = ''; +$channel_default_topic = ''; + +//$debug = 1; +?> Index: x2/tools/com_cservice/cservice.php diff -u /dev/null x2/tools/com_cservice/cservice.php:1.1 --- /dev/null Mon Jun 6 15:28:44 2005 +++ x2/tools/com_cservice/cservice.php Mon Jun 6 15:28:33 2005 @@ -0,0 +1,426 @@ +<?php +require_once ('classes/ircclient.php'); +require_once ('classes/template.php'); +require_once ('config.php'); +require_once ('regex.php'); + +define ('IRC_LOG_COMMUNICATIONS', TRUE); + +function do_step_one ( ) +{ + global $tpl, $channel_name, $channel_owner_handle, + $channel_owner_email, $channel_owner_password, + $irc, $irc_nick, $irc_user, $irc_name, $irc_host, + $irc_server, $irc_botnick, $dbx, $db_server, + $db_port, $db_user, $db_pass, $db_database, + $db_table; + + $tpl->set_file ('main', 'templates/aup.html'); + $tpl->set_block ('main', 'ErrorBlock', 'error_used_block'); + $tpl->set_var ( array ( + 'txtChannelName', + 'txtOwnerHandle', + 'txtOwnerPassword', + 'txtOwnerEmail' + ) ); + include ("lang/en.php"); + $tpl->pparse ('out', 'main'); +} + +function makePass() { + $makepass=""; + $syllables="er,in,tia,wol,fe,pre,vet,jo,nes,al,len,son,cha,ir,ler,bo,ok,tio,nar,sim,ple,bla,ten,toe,cho,co,lat,spe,ak,er,po,co,lor,pen,cil,li,ght,wh,at,the,he,ck,is,mam,bo,no,fi,ve,any,way,pol,iti,cs,ra,dio,sou,rce,sea,rch,pa,per,com,bo,sp,eak,st,fi,rst,gr,oup,boy,ea,gle,tr,ail,bi,ble,brb,pri,dee,kay,en,be,se"; + $syllable_array=explode(",", $syllables); + srand((double)microtime()*1000000); + for ($count=1;$count<=4;$count++) { + if (rand()%10 == 1) { + $makepass .= sprintf("%0.0f",(rand()%50)+1); + } else { + $makepass .= sprintf("%s",$syllable_array[rand()%62]); + } + } + return($makepass); +} + +function do_step_two() +{ + global $my, $tpl, $channel_name, $channel_owner_handle, + $channel_owner_email, $channel_owner_password, + $irc, $irc_nick, $irc_user, $irc_name, $irc_host, + $irc_server, $irc_botnick, $dbx, $db_server, + $db_port, $db_user, $db_pass, $db_database, + $db_table; + + $errors = array(); + $i = 0; + + $channel_name = post_clean ($_REQUEST['channel_name']); + + $channel_owner_handle = $my->username; + + $sql = "SELECT email FROM mos_users WHERE id=$my->id"; + $res = db_query($sql); + if(mysql_num_rows($res) < 1) + { + $errors[] = '{errYourIDWasNotFound}'; + } + else + { + $channel_owner_email = mysql_result($res, 0); + } + + $channel_owner_password = makePass(); + if ( !isset($_POST['iagree']) || $_POST['iagree'] <> 'true' ) + { + $errors[] = '{errAupNotAccepted}'; + } + if ( !validate_channel ($channel_name, 1, 49) ) { + $errors[] = '{errInvalidChannelName}'; + } + + else if ( channel_registered ($channel_name) ) { + $errors[] = '{errChannelIsRegisterd}'; + } + + + if ( count ($errors) > 0 ) + { + $tpl->set_file ('main', 'templates/aup.html'); + $tpl->set_var ( array ( + 'txtChannelName' => $channel_name, + ) ); + $tpl->set_block ('main', 'ErrorBlock', 'error_blk'); + + for ($i = 0; $i < count ($errors); $i++) + { + $tpl->set_var ('error', $errors[$i]); + $tpl->parse ('error_blk', 'ErrorBlock', true); + } + + include ("lang/en.php"); + $tpl->pparse ('out', 'main'); + } + + else + { + + $irc = new IRCClient ($irc_nick, $irc_user, $irc_name, $irc_host); + $irc->irc_register_callback ('001', 'irc_on_connect'); + $irc->irc_register_callback ('433', 'irc_on_nicknameinuse'); + $irc->irc_register_callback ('PRIVMSG', 'irc_on_privmsg'); + $irc->irc_register_callback ('NOTICE', 'irc_on_privmsg'); + $irc->irc_register_callback ('timeout', 'irc_on_timeout'); + $irc->irc_connect($irc_server); + return; + + } +} + +/* The purpose of this is.. ??? */ +function post_clean ( $key ) +{ + return trim ($key); +} + +function validate_channel ( $channel, $min=1, $max=200 ) +{ + global $_channel; + + // if ( preg_match ("/^{$_channel}{{$min},{$max}}$/", $channel) ) { + + if ( preg_match ('/^[#][A-Za-z0-9][A-Za-z0-9_.{}-]*$/', $channel) ) { + return true; + } + return false; +} + +function channel_registered ( $channel ) +{ + // DEBUG: Temp disabling due to + // lack of x2 on this server + return false; + global $chandatpath; + + $cf = fopen($chandatpath, "r"); + if($cf) + { + while($chans = fscanf($cf, "%s")) + { + list($chan) = $chans; + if(!strcasecmp($chan,$channel) or !strcasecmp($channel, "#afternet") or + !strcasecmp($channel, "#help") or + !strcasecmp($channel, "#Operations") ) + $conflict = 1; + } + } + if($conflict) + { + return true; + } + + return false; +} + +function db_connect () +{ + global $dbx; + global $db_server, $db_port, $db_user, $db_pass, $db_database; + + $dbx = @mysql_connect ("{$db_server}:{$db_port}", $db_user, $db_pass); + @mysql_select_db ($db_database); + + return $dbx; +} + +function db_query ( $query ) +{ + $dbx = db_connect(); + $res = @mysql_query ($query, $dbx); + + if (!$res) { + global $tpl; + $tpl->set_file ('main', 'templates/dberror.html'); + $tpl->set_var ('query', $query); + $tpl->set_var ('error', @mysql_error()); + $tpl->set_var ('errno', @mysql_errno()); + $tpl->pparse ('out', 'main'); + exit; + } + + return $res; +} + +function irc_on_connect ( $data, $object ) +{ + global $tpl, $channel_name, $channel_owner_handle, + $channel_owner_password, $channel_owner_email, + $irc, $irc_nick, $irc_user, $irc_name, $irc_host, + $irc_server, $irc_botnick, $irc_oper, $dbx, $db_server, + $db_port, $db_user, $db_pass, $db_database, + $db_table; + + /* We connected successfully. Send oper and scriptreg */ + $object->irc_send_msg("$irc_oper"); + $object->irc_send_msg ( + preg_replace('/[\n]/','', // no hacking me!! + sprintf ("PRIVMSG %s :SCRIPTREG %s %s %s %s %s", + $irc_botnick, $channel_name, $channel_owner_handle, + $channel_owner_password, $channel_owner_email, '+nt' ) + ) + ); + return(TRUE); +} + +function irc_on_privmsg ( $data, $object ) +{ + global $tpl, $channel_name, $channel_owner_handle, + $channel_owner_email, $channel_owner_password, + $irc, $irc_nick, $irc_user, $irc_name, $irc_host, + $irc_server, $irc_botnick, $dbx, $db_server, + $db_port, $db_user, $db_pass, $db_database, + $db_table; + + $nick = substr ($data[0], 0, strpos ($data[0], '!')); + + $data[3] = str_replace("\002", "", $data[3]); + if ( (strtoupper($data[2]) == strtoupper($object->irc_nick)) && ($nick == $irc_botnick) ) { + if ( preg_match ("/Owner\:\ SUCCESS/", $data[3]) ) { + $object->irc_disconnect(); + $query = sprintf ("insert into chanreg set channel_name='%s', + owner_handle='%s', owner_email='%s', owner_pass='%s', + status='OK', result='%s', timestamp=NULL, ip='%s'", + mysql_escape_string($channel_name), + mysql_escape_string($channel_owner_handle), + mysql_escape_string($channel_owner_email), + md5($channel_owner_password), + mysql_escape_string($data[3]), + $_SERVER['REMOTE_ADDR'] ); + $res = db_query ($query); + $tpl->set_file ('main', 'templates/regsuccess.html'); + $tpl->set_var ('owner_handle', $channel_owner_handle); + $tpl->set_var ('channel_name', $channel_name); + $tpl->set_var ('channel_owner_password', $channel_owner_password); + include ("lang/en.php"); + $tpl->pparse ('out', 'main'); + mail($channel_owner_email, "AfterNET channel registration for $channel_name", + "Just a reminder,\n". + "The channel registration for $channel_name has been\n". + "processed.\n\n". + "X2 is now in your channel. You can login by doing:\n". + "/msg x2 $channel_name login $channel_owner_handle $channel_owner_password\n\n ". + "Once logged in, please change your password by doing:\n". + "/msg x2 $channel_name pass $channel_owner_password yournewpassword\n\n". + "For more help with using x2, do /msg x2 help\n". + "Thanks,\n". + " AfterNET Support team\n". + "", + "From: su...@af...\nReply-To: su...@af...\n"); + + return(FALSE); + } + + elseif ( preg_match ("/(Registration Aborted|Error\:)/", $data[3]) ) { + $object->irc_disconnect(); + $query = sprintf ("insert into chanreg set channel_name='%s', + owner_handle='%s', owner_email='%s', owner_pass='%s', + status='ERR', result='%s', timestamp=NULL, ip='%s'", + mysql_escape_string($channel_name), + mysql_escape_string($channel_owner_handle), + mysql_escape_string($channel_owner_email), + md5($channel_owner_password), + mysql_escape_string($data[3]), + $_SERVER['REMOTE_ADDR'] ); + $res = db_query ($query); + $tpl->set_file ('main', 'templates/regfailed.html'); + $tpl->set_var ('owner_handle', $channel_owner_handle); + $tpl->set_var ('channel_name', $channel_name); + $tpl->set_var ('fail_reason', $data[3]); + include ("lang/en.php"); + $tpl->pparse ('out', 'main'); + return(FALSE); + } + } + return(TRUE); +} + +function irc_on_nicknameinuse ( $data, $object ) +{ + global $irc; + $irc->irc_nick = "{$irc->irc_nick}_"; + $irc->irc_send_msg (sprintf ("NICK %s", $irc->irc_nick)); + return(TRUE); +} + +function irc_on_timeout($data, $object) +{ + echo "Sorry, the registration process timed out. Please try again later."; + return(FALSE); +} + +function do_login_first() +{ + global $tpl, $channel_name, $channel_owner_handle, + $channel_owner_email, $channel_owner_password, + $irc, $irc_nick, $irc_user, $irc_name, $irc_host, + $irc_server, $irc_botnick, $dbx, $db_server, + $db_port, $db_user, $db_pass, $db_database, + $db_table; + + $tpl->set_file ('main', 'templates/must_login.html'); + include ("lang/en.php"); + $tpl->pparse ('out', 'main'); +} + +function do_show_too_many($reason) +{ + global $tpl, $channel_name, $channel_owner_handle, + $channel_owner_email, $channel_owner_password, + $irc, $irc_nick, $irc_user, $irc_name, $irc_host, + $irc_server, $irc_botnick, $dbx, $db_server, + $db_port, $db_user, $db_pass, $db_database, + $db_table; + + $tpl->set_file ('main', 'templates/too_many.html'); + $tpl->set_var ('Error', $reason); + include("lang/en.php"); + $tpl->pparse('out', 'main'); +} + + +function rate_limit() +{ + global $my; + global $tpl, $channel_name, $channel_owner_handle, + $channel_owner_email, $channel_owner_password, + $irc, $irc_nick, $irc_user, $irc_name, $irc_host, + $irc_server, $irc_botnick, $dbx, $db_server, + $db_port, $db_user, $db_pass, $db_database, + $db_table; + + /* 1 channel per day check */ + $yesterday = time() - (24 * 60 * 60); + $strSQL = " + select count(channel_name) + FROM chanreg + WHERE owner_handle='$my->username' + AND status='OK' + AND unix_timestamp(timestamp) > $yesterday + "; + $res = db_query($strSQL); + if(mysql_result($res, 0) > 0) + { + return("You may register only one channel per day"); + } + + /* 3 channels per month check */ + $lastmonth = time() - (24 * 60 * 60 * 30); + $strSQL = " + SELECT count(channel_name) + FROM chanreg + WHERE owner_handle='$my->username' + AND status='OK' + AND unix_timestamp(timestamp) > $lastmonth + "; + $res = db_query($strSQL); + if(mysql_result($res, 0) >= 3) + { + return("You may register only one channel per month"); + } + + /* max 100 channels per day for all users */ + $yesterday = time() - (24 * 60 * 60); + $strSQL = " + select count(channel_name) + FROM chanreg + WHERE status='OK' + AND unix_timestamp(timestamp) > $yesterday + "; + $res = db_query($strSQL); + if(mysql_result($res, 0) > 50) + { + return("Our registration system is currently overloaded. Please check back tomorrow."); + } + /* max 3 channels per day for same IP address */ + $yesterday = time() - (24 * 60 * 60); + $strSQL = " + select count(channel_name) + FROM chanreg + WHERE status='OK' + AND unix_timestamp(timestamp) > $yesterday + AND ip='$_SERVER[REMOTE_ADDR]' + "; + $res = db_query($strSQL); + if(mysql_result($res, 0) >= 3) + { + return("Too many registrations from your IP. Please contact us."); + } + return FALSE; +} + +$dbx = db_connect(); +$tpl = new Template(); +$irc = new IRCClient ($irc_nick, $irc_user, $irc_name, $irc_host); + +if(!$my->id) +{ + do_login_first(); +} +else +{ + switch ($_REQUEST['step']) + { + default: + case '1': + do_step_one(); + break; + + case '2': + $reason = rate_limit(); + if($reason) + do_show_too_many($reason); + else + do_step_two(); + break; + } +} +?> Index: x2/tools/com_cservice/help/errInvalidChannelName.html diff -u /dev/null x2/tools/com_cservice/help/errInvalidChannelName.html:1.1 --- /dev/null Mon Jun 6 15:28:44 2005 +++ x2/tools/com_cservice/help/errInvalidChannelName.html Mon Jun 6 15:28:33 2005 @@ -0,0 +1,16 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>Invalid Channel Name</title> +<script type="text/javascript" src="helpdocs.js"></script> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +</head> +<body> +<h2>Invalid Channel Name</h2> +<p>Your channel name must be bewteen 1 and 49 characters in length and may contain only alpha-numeric characters (a-Z, 0-9).</p> +<p><code>Ex. #AfterNet</code></p> +<p align="center"> + <button onclick="close_help()">close</button> +</p> +</body> +</html> Index: x2/tools/com_cservice/help/errInvalidEmailDomain.html diff -u /dev/null x2/tools/com_cservice/help/errInvalidEmailDomain.html:1.1 --- /dev/null Mon Jun 6 15:28:44 2005 +++ x2/tools/com_cservice/help/errInvalidEmailDomain.html Mon Jun 6 15:28:33 2005 @@ -0,0 +1,15 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>Invalid E-Mail Domain Detected</title> +<script type="text/javascript" src="helpdocs.js"></script> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +</head> +<body> +<h2>Invalid E-Mail Domain Detected</h2> +<p>We do not accept public or anonymous email accounts! DO NOT enter public free accounts such as hotmail, yahoo, or mail.com. Please use your real ISP email account. It will never be givin to anyone or used in any way other than to verify your identity and for us to contact you.</p> +<p align="center"> + <button onclick="close_help()">close</button> +</p> +</body> +</html> Index: x2/tools/com_cservice/help/errInvalidOwnerEmail.html diff -u /dev/null x2/tools/com_cservice/help/errInvalidOwnerEmail.html:1.1 --- /dev/null Mon Jun 6 15:28:44 2005 +++ x2/tools/com_cservice/help/errInvalidOwnerEmail.html Mon Jun 6 15:28:33 2005 @@ -0,0 +1,16 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>Invalid Owner E-mail Address</title> +<script type="text/javascript" src="helpdocs.js"></script> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +</head> +<body> +<h2>Invalid Owner E-mail Address</h2> +<p>Your email address should be in the form of <user>@<host>.[com|net|org]. Please verify you enter the correct address, important information regarding channel registration will be sent to this address.</p> +<p><code>Ex. jo...@af...</code></p> +<p align="center"> + <button onclick="close_help()">close</button> +</p> +</body> +</html> Index: x2/tools/com_cservice/help/errInvalidOwnerHandle.html diff -u /dev/null x2/tools/com_cservice/help/errInvalidOwnerHandle.html:1.1 --- /dev/null Mon Jun 6 15:28:44 2005 +++ x2/tools/com_cservice/help/errInvalidOwnerHandle.html Mon Jun 6 15:28:33 2005 @@ -0,0 +1,16 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>Invalid Owner Handle</title> +<script type="text/javascript" src="helpdocs.js"></script> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +</head> +<body> +<h2>Invalid Owner Handle</h2> +<p>Your handle (nickname) must be bewteen 1 and 30 characters in length and may contain only alpha-numeric characters (a-Z, 0-9).</p> +<p><code>Ex. john37m</code></p> +<p align="center"> + <button onclick="close_help()">close</button> +</p> +</body> +</html> Index: x2/tools/com_cservice/help/errInvalidOwnerPassword.html diff -u /dev/null x2/tools/com_cservice/help/errInvalidOwnerPassword.html:1.1 --- /dev/null Mon Jun 6 15:28:44 2005 +++ x2/tools/com_cservice/help/errInvalidOwnerPassword.html Mon Jun 6 15:28:33 2005 @@ -0,0 +1,16 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>Invalid Owner Password</title> +<script type="text/javascript" src="helpdocs.js"></script> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +</head> +<body> +<h... [truncated message content] |