From 0df0e5f1e927ea1d04bd5ef3c12be3bc2c72837c Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 4 Aug 2008 12:12:25 +0000 Subject: Central: Wrote installation script Closes #4 --- central/trunk/instadisc.php | 14 +- central/trunk/instadisc.sql | 129 +++++++++++++++++ central/trunk/install.php | 346 +++++++++++++++++++++++++++++++++++++++++++- central/trunk/uniform.css | 268 ++++++++++++++++++++++++++++++++++ central/trunk/xmlrpc.php | 18 +-- 5 files changed, 751 insertions(+), 24 deletions(-) create mode 100644 central/trunk/instadisc.sql create mode 100644 central/trunk/uniform.css (limited to 'central') diff --git a/central/trunk/instadisc.php b/central/trunk/instadisc.php index 9883116..7ad11ee 100644 --- a/central/trunk/instadisc.php +++ b/central/trunk/instadisc.php @@ -91,7 +91,7 @@ function instaDisc_sendDatabase($cserver) $i=0; while ($getdb3[$i] = mysql_fetch_array($getdb2)) { - $db[$getdb3[$i]['url']]['key'] = $getdb3[$i]['key']; + $db[$getdb3[$i]['url']]['code'] = $getdb3[$i]['code']; $db[$getdb3[$i]['url']]['xmlrpc'] = $getdb3[$i]['xmlrpc']; $i++; } @@ -105,7 +105,7 @@ function instaDisc_sendDatabase($cserver) $client = new xmlrpc_client($cserver); $msg = new xmlrpcmsg("InstaDisc.sendDatabase", array( new xmlrpcval($cserver2, 'string'), - new xmlrpcval(md5($cserver2 + ":" + $getuk3['key'] + ":" + $verID), 'string'), + new xmlrpcval(md5($cserver2 + ":" + $getuk3['code'] + ":" + $verID), 'string'), new xmlrpcval($verID, 'int'), new xmlrpcval($db, 'array'))); $client->send($msg); @@ -152,7 +152,7 @@ function instaDisc_sendActivationEmail($username, $password, $email) { $penKey = md5(rand(1,65536)); - $inspending = "INSERT INTO pending (username, password, email, key) VALUES (\"" . mysql_real_escape_string($username) . "\", \"" . mysql_real_escape_string(md5($password)) . "\", \"" . mysql_real_escape_string($email) . "\", \"" . mysql_real_escape_string($penKey) . "\")"; + $inspending = "INSERT INTO pending (username, password, email, code) VALUES (\"" . mysql_real_escape_string($username) . "\", \"" . mysql_real_escape_string(md5($password)) . "\", \"" . mysql_real_escape_string($email) . "\", \"" . mysql_real_escape_string($penKey) . "\")"; $inspending2 = mysql_query($inspending); $mail = instaDisc_phpMailer(); @@ -165,7 +165,7 @@ function instaDisc_sendActivationEmail($username, $password, $email) function instaDisc_activateAccount($username, $penKey) { - $getuser = "SELECT * FROM pending WHERE username = \"" . mysql_real_escape_string($username) . "\" AND key = \"" . mysql_real_escape_string($penKey) . "\""; + $getuser = "SELECT * FROM pending WHERE username = \"" . mysql_real_escape_string($username) . "\" AND code = \"" . mysql_real_escape_string($penKey) . "\""; $getuser2 = mysql_query($getuser); $getuser3 = mysql_fetch_array($getuser2); if ($getuser3['username'] == $username) @@ -189,7 +189,7 @@ function instaDisc_activateAccount($username, $penKey) function instaDisc_deactivateAccount($username, $penKey) { - $getuser = "SELECT * FROM pending WHERE username = \"" . mysql_real_escape_string($username) . "\" AND key = \"" . mysql_real_escape_string($penKey) . "\""; + $getuser = "SELECT * FROM pending WHERE username = \"" . mysql_real_escape_string($username) . "\" AND code = \"" . mysql_real_escape_string($penKey) . "\""; $getuser2 = mysql_query($getuser); $getuser3 = mysql_fetch_array($getuser2); if ($getuser3['username'] == $username) @@ -310,7 +310,7 @@ function instaDisc_listPendingSubscriptions($username) $i=0; while ($getsubs3[$i] = mysql_fetch_array($getsubs2)) { - $subs[$i] = array('url' => $getsubs3[$i]['url'], 'key' => $getsubs3[$i]['key']); + $subs[$i] = array('url' => $getsubs3[$i]['url'], 'code' => $getsubs3[$i]['code']); $i++; } @@ -328,7 +328,7 @@ function instaDisc_generateSubscriptionActivation($username, $url) { $key = md5(rand(1,65536)); - $inspending = "INSERT INTO pending2 (username, url, key) VALUES (\"" . mysql_real_escape_string($username) . "\", \"" . mysql_real_escape_string($url) . "\", \"" . mysql_real_escape_string($key) . "\")"; + $inspending = "INSERT INTO pending2 (username, url, code) VALUES (\"" . mysql_real_escape_string($username) . "\", \"" . mysql_real_escape_string($url) . "\", \"" . mysql_real_escape_string($key) . "\")"; $inspending2 = mysql_query($inspending); return $key; diff --git a/central/trunk/instadisc.sql b/central/trunk/instadisc.sql new file mode 100644 index 0000000..b3de26e --- /dev/null +++ b/central/trunk/instadisc.sql @@ -0,0 +1,129 @@ +-- phpMyAdmin SQL Dump +-- version 2.9.1.1 +-- http://www.phpmyadmin.net +-- +-- Host: localhost +-- Generation Time: Aug 03, 2008 at 04:54 PM +-- Server version: 5.0.51 +-- PHP Version: 5.2.4-2ubuntu5.3 +-- +-- Database: `instadisc` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `centralServers` +-- + +CREATE TABLE IF NOT EXISTS `centralServers` ( + `id` int(11) NOT NULL auto_increment, + `url` varchar(255) NOT NULL, + `code` varchar(255) NOT NULL, + `xmlrpc` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `config` +-- + +CREATE TABLE IF NOT EXISTS `config` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(255) NOT NULL, + `value` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `inbox` +-- + +CREATE TABLE IF NOT EXISTS `inbox` ( + `id` int(11) NOT NULL auto_increment, + `username` varchar(255) NOT NULL, + `itemID` int(11) NOT NULL, + `subscription` varchar(255) NOT NULL, + `title` varchar(255) NOT NULL, + `author` varchar(255) NOT NULL, + `url` varchar(255) NOT NULL, + `semantics` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `oldVerID` +-- + +CREATE TABLE IF NOT EXISTS `oldVerID` ( + `id` int(11) NOT NULL auto_increment, + `username` varchar(255) NOT NULL, + `verID` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `pending` +-- + +CREATE TABLE IF NOT EXISTS `pending` ( + `id` int(11) NOT NULL auto_increment, + `username` varchar(255) NOT NULL, + `password` varchar(255) NOT NULL, + `email` varchar(255) NOT NULL, + `code` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `pending2` +-- + +CREATE TABLE IF NOT EXISTS `pending2` ( + `id` int(11) NOT NULL auto_increment, + `username` varchar(255) NOT NULL, + `url` varchar(255) NOT NULL, + `code` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `subscriptions` +-- + +CREATE TABLE IF NOT EXISTS `subscriptions` ( + `id` mediumint(11) NOT NULL auto_increment, + `username` varchar(255) NOT NULL, + `url` varchar(255) NOT NULL, + `owner` varchar(5) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `users` +-- + +CREATE TABLE IF NOT EXISTS `users` ( + `id` int(11) NOT NULL auto_increment, + `username` varchar(255) NOT NULL, + `password` varchar(255) NOT NULL, + `email` varchar(255) NOT NULL, + `ip` varchar(255) NOT NULL, + `nextItemID` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + diff --git a/central/trunk/install.php b/central/trunk/install.php index d04e99b..7b5514f 100644 --- a/central/trunk/install.php +++ b/central/trunk/install.php @@ -2,20 +2,350 @@ /* InstaDisc Server - A Four Island Project */ -if (!isset($_GET['step'])) +$softwareVersion = 1; + +if (!isset($_GET['submit'])) +{ + showHeader('1'); + showStepOne('localhost', 'root', '', 'instadisc', array()); +} else { + $numOfErrors = 0; + $errors = array(); + + switch ($_GET['submit']) + { + case 1: + if ($_POST['host'] == '') + { + addError($numOfErrors, $errors, 'host', 'Hostname is a required field'); + } + + if ($_POST['username'] == '') + { + addError($numOfErrors, $errors, 'username', 'Username is a required field'); + } + + if ($_POST['password'] == '') + { + addError($numOfErrors, $errors, 'password', 'Password is a required field'); + } + + if ($_POST['dbname'] == '') + { + addError($numOfErrors, $errors, 'dbname', 'Name is a required field'); + } + + if ($numOfErrors > 0) + { + showHeader('1'); + showStepOne($_POST['host'], $_POST['username'], $_POST['password'], $_POST['dbname'], $errors); + } else { + if (!@mysql_connect($_POST['host'], $_POST['username'], $_POST['password'])) + { + addError($numOfErrors, $errors, '', 'Cannot connect to database server'); + showHeader('1'); + showStepOne($_POST['host'], $_POST['username'], $_POST['password'], $_POST['dbname'], $errors); + } else { + if (!@mysql_select_db($_POST['dbname'])) + { + addError($numOfErrors, $errors, 'dbname', 'Database does not exist'); + showHeader('1'); + showStepOne($_POST['host'], $_POST['username'], $_POST['password'], $_POST['dbname'], $errors); + } else { + $sql = file_get_contents('instadisc.sql'); + $makedb = split(';', $sql); + foreach ($makedb as $name => $value) + { + if (!trim($value) == '') + { + $makedb2 = @mysql_query($value); + if (!$makedb2) + { + addError($numOfErrors, $errors, '', "MySQL error \"" . mysql_error() . "\" while creating database"); + } + } + } + + @file_put_contents('config.php', ""); + + if (!file_exists('config.php')) + { + addError($numOfErrors, $errors, '', 'Could not write config.php file, please check directory permissions'); + } + + if ($numOfErrors > 0) + { + showHeader('1'); + showStepOne($_POST['host'], $_POST['username'], $_POST['password'], $_POST['dbname'], $errors); + } else { + showHeader('2'); + showStepTwo('','',' CHECKED','','','','','','','', array()); + } + } + } + } + + break; + + case 2: + if ($_POST['mailDomain'] == '') + { + addError($numOfErrors, $errors, 'mailDomain', 'Mail Domain is a required field'); + } + + if ($_POST['smtpHost'] == '') + { + addError($numOfErrors, $errors, 'smtpHost', 'SMTP Host is a required field'); + } + + if ($_POST['smtpAuth'] == 'on') + { + if ($_POST['smtpUser'] == '') + { + addError($numOfErrors, $errors, 'smtpUser', 'When "SMTP Authentication Required?" is checked, SMTP Username is a required field'); + } + + if ($_POST['smtpPass'] == '') + { + addError($numOfErrors, $errors, 'smtpPass', 'When "SMTP Authentication Required?" is checked, SMTP Password is a required field'); + } + } + + if ($_POST['siteName'] == '') + { + addError($numOfErrors, $errors, 'siteName', 'Site Name is a required field'); + } + + if ($_POST['xmlrpcURL'] == '') + { + addError($numOfErrors, $errors, 'xmlrpcURL', 'XML-RPC URL is a required field'); + } else { + include_once('xmlrpc/xmlrpc.inc'); + + $client = new xmlrpc_client($_POST['xmlrpcURL']); + $msg = new xmlrpcmsg('system.listMethods'); + $r = $client->send($msg); + if (stripos($r->faultString(),'Connect error') !== FALSE) + { + addError($numOfErrors, $errors, 'xmlrpcURL', $r->faultString()); + } + } + + if ($_POST['adminUser'] == '') + { + addError($numOfErrors, $errors, 'adminUser', 'Admin Username is a required field'); + } + + if ($_POST['adminPass'] == '') + { + addError($numOfErrors, $errors, 'adminPass', 'Admin Password is a required field'); + } + + if ($_POST['adminEmail'] == '') + { + addError($numOfErrors, $errors, 'adminEmail', 'Admin Email is a required field'); + } + + if ($numOfErrors > 0) + { + showHeader('2'); + showStepTwo($_POST['mailDomain'], $_POST['smtpHost'], ($_POST['smtpAuth'] == 'on' ? ' CHECKED' : ''), $_POST['smtpUser'], $_POST['smtpPass'], $_POST['siteName'], $_POST['xmlrpcURL'], $_POST['adminUser'], $_POST['adminPass'], $_POST['adminEmail'], $errors); + } else { + include_once('config.php'); + + mysql_connect($dbhost, $dbuser, $dbpass); + mysql_select_db($dbname); + + $sql[0] = "INSERT INTO config (name,value) VALUES (\"mailDomain\",\"" . mysql_real_escape_string($_POST['mailDomain']) . "\")"; + $sql[1] = "INSERT INTO config (name,value) VALUES (\"smtpHost\",\"" . mysql_real_escape_string($_POST['smtpHost']) . "\")"; + $sql[2] = "INSERT INTO config (name,value) VALUES (\"smtpAuth\",\"" . mysql_real_escape_string($_POST['smtpAuth']) . "\")"; + $sql[3] = "INSERT INTO config (name,value) VALUES (\"smtpUser\",\"" . mysql_real_escape_string($_POST['smtpUser']) . "\")"; + $sql[4] = "INSERT INTO config (name,value) VALUES (\"smtpPass\",\"" . mysql_real_escape_string($_POST['smtpPass']) . "\")"; + $sql[5] = "INSERT INTO config (name,value) VALUES (\"siteName\",\"" . mysql_real_escape_string($_POST['siteName']) . "\")"; + $sql[6] = "INSERT INTO config (name,value) VALUES (\"xmlrpcURL\",\"" . mysql_real_escape_string($_POST['xmlrpcURL']) . "\")"; + $sql[7] = "INSERT INTO config (name,value) VALUES (\"owner\",\"" . mysql_real_escape_string($_POST['adminUser']) . "\")"; + $sql[8] = "INSERT INTO config (name,value) VALUES (\"verIDBufferSize\",\"100\")"; + $sql[9] = "INSERT INTO config (name,value) VALUES (\"softwareVersion\",\"" . $softwareVersion . "\")"; + $sql[10] = "INSERT INTO config (name,value) VALUES (\"databaseVersion\",\"1\")"; + $sql[11] = "INSERT INTO users (username, password, email, ip) VALUES (\"" . mysql_real_escape_string($_POST['adminUser']) . "\",\"" . mysql_real_escape_string(md5($_POST['adminPass'])) . "\",\"" . mysql_real_escape_string($_POST['adminEmail']) . "\",\"" . mysql_real_escape_string($_SERVER['REMOTE_IP']) . "\")"; + $sql[12] = "INSERT INTO centralServers (url, code, xmlrpc) VALUES (\"" . mysql_real_escape_string('central.fourisland.com') . "\",\"" . mysql_real_escape_string(md5('central.fourisland.com')) . "\",\"" . mysql_real_escape_string('http://central.fourisland.com/xmlrpc.php') . "\")"; + + foreach ($sql as $name => $value) + { + if (!trim($value) == '') + { + $sql2 = @mysql_query($value); + if (!$sql2) + { + addError($numOfErrors, $errors, '', "MySQL error \"" . mysql_error() . "\" while filling database"); + } + } + } + + if ($numOfErrors > 0) + { + showHeader('2'); + showStepTwo($_POST['mailDomain'], $_POST['smtpHost'], ($_POST['smtpAuth'] == 'on' ? ' CHECKED' : ''), $_POST['smtpUser'], $_POST['smtpPass'], $_POST['siteName'], $_POST['xmlrpcURL'], $_POST['adminUser'], $_POST['adminPass'], $_POST['adminEmail'], $errors); + } else { + showHeader('3'); + showStepThree(); + } + } + + break; + } +} + +?>

InstaDisc (C) Starla Insigna 2008. InstaDisc Setup uses the UniForm form theme
Welcome to the InstaDisc Central Server installation! Please input your database details here:

Database host:
Username:
Password:
Database name: (Note: You must create this database BEFORE running installation)
InstaDisc Server Setup Step <?php echo($number); ?>

InstaDisc Installation

Welcome to the InstaDisc Central Server installation! Please input your database details below.

+

+Cannot connect to your database server! Please verify you typed you host, username and password correctly. Back
Uh oh! Validation errors!

+

    $value) + { +?>
+
Database Details +
+ + +
+
+ + +
+
+ + +
+
+ + +

You need to create this database before running this script.

+
+
+
+ +
Your database has been set up. All we need to do now is fill it up a little. Please answer the below questions to set up your configuration: +
+Cannot connect to your database! Please verify that the database you specified already exists and that you spelled it correctly. Back
Uh oh! Validation errors!

+

    $value) + { +?>
+
Email +
+ + +

Type in the part that comes after the @ in your email addresses. This is used when InstaDisc needs to send an email to someone.

+
+
+ + +

This is required because InstaDisc has to be able to send emails to people.

+
+
+ + "> +

If your SMTP server requires authentication (most do), you need to check this box and enter the authentication details in the fields below.

+
+
+ + +
+
+ + +

The two above fields only need be filled out if the "SMTP Authentication Required?" box is checked.

+
+
Website +
+ + +

Your website's name is required for a little personalization of emails.

+
+
+ + +

What is the URL of the xmlrpc.php file provided for you in the InstaDisc package?

+
+
Administrator's Account +
+ + +
+
+ + +
+
+ + +

You, the administrator, must have an account on your InstaDisc server to be able to edit configuration values (mostly the ones you just entered) at will.

+
+
+
+ +
Congradulations! You've successfully set up your InstaDisc Central Server's database! Now, the next step for you is to implement the functions in instadisc.php into your web application. Read README.txt for more information. + +function ifErrors($errors, $id) +{ + foreach ($errors as $name => $value) + { + if ($value['field'] == $id) + { + echo(' error'); + return; + } + } +} + + +function doErrors($errors, $id) +{ + foreach ($errors as $name => $value) + { + if ($value['field'] == $id) + { +?>

*

$field, 'msg' => $msg); +} diff --git a/central/trunk/uniform.css b/central/trunk/uniform.css new file mode 100644 index 0000000..ae810cb --- /dev/null +++ b/central/trunk/uniform.css @@ -0,0 +1,268 @@ +/* uniForm */ + .uniForm{ + margin:0; padding:0; + position:relative; + width:100%; + /* user prefs */ + padding:10px 0; + } + + /* Some generals */ + .uniForm fieldset{ + border:none; + margin:0; padding:0; + /* user prefs */ + margin:0 0 7px 0; padding:0 0 10px 0; + border-bottom:1px solid #efefef; + } + .uniForm fieldset legend{ + color:#000; /* Reset IE */ + margin:0; padding:0; + /* user prefs */ + margin:0 0 .5em 0; + font:bold small-caps 100%/100% "lucida grande", "lucida sans unicode", "trebuchet ms", arial, verdana, sans-serif; + letter-spacing:.1em; + color:#93b5be; + } + + .ctrlHolder{ /* This is the main unit that contains our form "modules" */ + overflow:hidden; + margin:0; padding:0; + clear:both; + /* user prefs */ + background:#f9f9f9; + margin:0; padding:7px 4px; + } + + .buttonHolder{ + overflow:hidden; + clear:both; + /* user prefs */ + background:#f9f9f9; + border:1px solid #ccc; border-width:1px 0; + margin:10px 0 0 0; padding:10px; + text-align:right; + } + .resetButton{ + } + .submitButton{ + } + + .uniForm .inlineLabel{ + width:auto; + float:none; + display:inline; + /* user prefs */ + margin:0 2em 0 0; + font-weight:normal; + } + .uniForm .inlineLabel input{ + } + + /* Highlighting the rows on input focus */ + .focused{ + background:#FFFCDF url(/theme/images/uf_focused.png); + border:1px solid #EFE795; border-width:1px 0; + padding:6px 4px; + } + + + /* Styles for form controls where labels are in line with the input elements */ + /* Set the class to the parent to .inlineLabels */ + .inlineLabels .ctrlHolder{ + } + .inlineLabels label, + .inlineLabels .label{ + float:left; + margin:.3em 0 0 0; padding:0; + line-height:100%; + /* user prefs */ + width:30%; + font-weight:bold; + } + + .inlineLabels .textInput, + .inlineLabels .fileUpload{ + float:left; + /* user prefs */ + width:68%; + border:2px solid #dfdfdf; + } + .inlineLabels .fileUpload > input{ + } + + .inlineLabels .selectInput{ + float:left; + /* user prefs */ + width:69%; + border:2px solid #dfdfdf; + } + + .inlineLabels textarea{ + float:left; + width:68%; + /* user prefs */ + border:2px solid #dfdfdf; + height:12em; + } + + .inlineLabels .formHint{ + clear:both; + /* user prefs */ + color:#999; + margin:.5em 0 0 30%; padding:3px 0; + font-size:80%; + } + + /* inlineLabels esthetics */ + .inlineLabels .formHint strong{ + padding:0 0 0 14px; + background:url(/theme/images/icon_alert.png) 0 0 no-repeat; + display:inline-block; + } + + + /* ########################################################################## */ + + /* Styles for form controls where labels are above the input elements */ + /* Set the class to the parent to .blockLabels */ + .blockLabels .ctrlHolder{ + } + + .blockLabels label, + .blockLabels .label{ + display:block; + float:none; + margin:.3em 0; padding:0; + line-height:100%; + width:60%; + /* user prefs */ + font-weight:bold; + width:auto; + } + .blockLabels .label{ + float:left; + margin-right:3em; + } + + .blockLabels .textInput{ + float:left; + width:60%; + /* user prefs */ + border:2px solid #dfdfdf; + } + + .blockLabels .selectInput{ + float:left; + width:60%; + /* user prefs */ + border:2px solid #dfdfdf; + + } + + .blockLabels textarea{ + display:block; + float:left; + /* user prefs */ + border:2px solid #dfdfdf; + height:12em; + } + + .blockLabels .formHint{ + float:right; + margin:0; + width:38%; + clear:none; + /* user prefs */ + color:#999; + font-size:80%; + font-style:italic; + } + + /* blockLabels esthetics */ + .blockLabels .ctrlHolder{ + border:1px solid #dfdfdf; border-width:1px 0; + margin-top:-1px; + } + + .blockLabels .focused{ + padding:7px 4px; + } + + /* ########################################################################## */ + + /* Focus pseudoclasses */ + .ctrlHolder .textInput:focus{ + border-color:#DFD77D; + } + div.focused .textInput:focus{ + } + div.focused .formHint{ + color:#000; + } + + /* Required asterisk styling, use if needed */ + label em, + .label em{ + display:block; + position:absolute; left:28%; + font-style:normal; + font-weight:bold; + } + .blockLabels label em, + .blockLabels .label em{ + position:static; + display:inline; + } + + /* Messages */ + .uniForm #errorMsg{ + background:#ffdfdf url(/theme/images/uf_error.png); + border:1px solid #df7d7d; border-width:1px 0; + margin:0 0 1em 0; padding:1em; + } + .uniForm .error, + .uniForm .blockLabels.ctrlHolder.error{ + background:#ffdfdf url(/theme/images/uf_error.png); + border:1px solid #df7d7d; border-width:1px 0; + position:relative; + } + .uniForm #errorMsg dt, + .uniForm #errorMsg h3{ + margin:0 0 .5em 0; + font-size:110%; + line-height:100%; + font-weight:bold; + color:#000; + padding:2px 0 2px 18px; + background:url(/theme/images/icon-error.png) 0 0 no-repeat; + } + .uniForm #errorMsg dd{ + margin:0; padding:0; + } + .uniForm #errorMsg ol{ + margin:0; padding:0; + } + .uniForm #errorMsg ol li{ + margin:0; padding:2px; + list-style-position:inside; + border-bottom:1px dotted #df7d7d; + position:relative; + } + .uniForm .errorField{ + margin:0 0 3px 0; + } + .uniForm .inlineLabels .errorField{ + margin-left:30%; + } + .uniForm .errorField strong{ + background:#FFE2E2; + padding:1px 3px 3px 3px; + } + .ctrlHolder.error input, + .ctrlHolder.error input:focus{ + border-color:#DF7D7D; + } + .ctrlHolder.error.focused{ + padding:7px 4px; + } diff --git a/central/trunk/xmlrpc.php b/central/trunk/xmlrpc.php index 5377a3b..efaa70f 100644 --- a/central/trunk/xmlrpc.php +++ b/central/trunk/xmlrpc.php @@ -96,7 +96,7 @@ function sendFromUpdate($username, $verification, $verificationID, $subscription $client = new xmlrpc_client($getcs3[$i]['xmlrpc']); $msg = new xmlrpcmsg("InstaDisc.sendFromCentral", array( new xmlrpcval($cserver, 'string'), - new xmlrpcval(md5($cserver + ":" + $getuk3['key'] + ":" + $verID), 'string'), + new xmlrpcval(md5($cserver + ":" + $getuk3['code'] + ":" + $verID), 'string'), new xmlrpcval($verID, 'int'), new xmlrpcval($subscription, 'string'), new xmlrpcval($title, 'string'), @@ -118,7 +118,7 @@ function sendFromUpdate($username, $verification, $verificationID, $subscription function sendFromCentral($cserver, $verification, $verificationID, $subscription, $title, $author, $url, $semantics, $softwareVersion, $databaseVersion) { - if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'key')) + if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'code')) { if ($softwareVersion > instaDisc_getConfig('softwareVersion')) { @@ -134,7 +134,7 @@ function sendFromCentral($cserver, $verification, $verificationID, $subscription $client = new xmlrpc_client($cserver); $msg = new xmlrpcmsg("InstaDisc.sendUpdateNotice", array( new xmlrpcval($cserver2, 'string'), - new xmlrpcval(md5($cserver2 . ':' . $getuk3['key'] . ':' . $verID), 'string'), + new xmlrpcval(md5($cserver2 . ':' . $getuk3['code'] . ':' . $verID), 'string'), new xmlrpcval($verID, 'int'), new xmlrpcval(instaDisc_getConfig('softwareVersion'), 'int'))); $client->send($msg); @@ -151,7 +151,7 @@ function sendFromCentral($cserver, $verification, $verificationID, $subscription $client = new xmlrpc_client($cserver); $msg = new xmlrpcmsg("InstaDisc.askForDatabase", array( new xmlrpcval($cserver2, 'string'), - new xmlrpcval(md5($cserver2 . ':' . $getuk3['key'] . ':' . $verID), 'string'), + new xmlrpcval(md5($cserver2 . ':' . $getuk3['code'] . ':' . $verID), 'string'), new xmlrpcval($verID, 'int'), new xmlrpcval(instaDisc_getConfig('databaseVersion'), 'int'))); $client->send($msg); @@ -177,7 +177,7 @@ function sendFromCentral($cserver, $verification, $verificationID, $subscription function sendUpdateNotice($cserver, $verification, $verificationID, $softwareVersion) { - if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'key')) + if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'code')) { if ($softwareVersion > instaDisc_getConfig('softwareVersion')) { @@ -192,7 +192,7 @@ function sendUpdateNotice($cserver, $verification, $verificationID, $softwareVer function askForDatabase($cserver, $verification, $verificationID, $databaseVersion) { - if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'key')) + if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'code')) { if ($databaseVersion < instaDisc_getConfig('databaseVersion')) { @@ -239,7 +239,7 @@ function addSubscription($username, $verification, $verificationID, $subscriptio function sendDatabase($cserver, $verification, $verificationID, $db) { - if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'key')) + if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'code')) { if (isset($db['central.fourisland.com'])) { @@ -247,14 +247,14 @@ function sendDatabase($cserver, $verification, $verificationID, $db) $getfi2 = mysql_query($getfi); $getfi3 = mysql_fetch_array($getfi2); - if ($db['central.fourisland.com']['key'] == $getfi3['key']) + if ($db['central.fourisland.com']['code'] == $getfi3['code']) { $deldb = "DELETE FROM centralServers"; $deldb2 = mysql_query($deldb); foreach($db as $name => $value) { - $insdb = "INSERT INTO centralServers (url, key, xmlrpc) VALUES (\"" . mysql_real_escape_string($name) . "\", \"" . mysql_real_escape_string($value['key']) . "\", \"" . mysql_real_escape_string($value['xmlrpc']) . "\")"; + $insdb = "INSERT INTO centralServers (url, code, xmlrpc) VALUES (\"" . mysql_real_escape_string($name) . "\", \"" . mysql_real_escape_string($value['code']) . "\", \"" . mysql_real_escape_string($value['xmlrpc']) . "\")"; $insdb2 = mysql_query($insdb); } -- cgit 1.4.1