CREATE DATABASE weavedb;
USE weavedb;
CREATE TABLE `collections` (
`userid` int(11) NOT NULL,
`collectionid` smallint(6) NOT NULL,
`name` varchar(32) NOT NULL,
PRIMARY KEY (`userid`,`collectionid`),
KEY `nameindex` (`userid`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(32) DEFAULT NULL,
`password_hash` varbinary(128) DEFAULT NULL,
`email` varbinary(64) DEFAULT NULL,
`status` tinyint(4) DEFAULT '1',
`alert` text,
`reset` varbinary(32) DEFAULT NULL,
`reset_expiration` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1;
CREATE TABLE `wbo` (
`username` int(11) NOT NULL,
`collection` smallint(6) NOT NULL DEFAULT '0',
`id` varbinary(64) NOT NULL DEFAULT '',
`parentid` varbinary(64) DEFAULT NULL,
`predecessorid` varbinary(64) DEFAULT NULL,
`sortindex` int(11) DEFAULT NULL,
`modified` bigint(20) DEFAULT NULL,
`payload` longtext,
`payload_size` int(11) DEFAULT NULL,
`ttl` int(11) DEFAULT '2100000000',
PRIMARY KEY (`username`,`collection`,`id`),
KEY `parentindex` (`username`,`collection`,`parentid`),
KEY `modified` (`username`,`collection`,`modified`),
KEY `weightindex` (`username`,`collection`,`sortindex`),
KEY `predecessorindex` (`username`,`collection`,`predecessorid`),
KEY `size_index` (`username`,`payload_size`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
installer le serveur fourni par | ![]() |
dans notre exemple on l'installera sous weave\weaveserver_registration |
installer le serveur de synchronisation fourni par | ![]() |
dans notre exemple on l'installera sous weave\weaveserver_sync |
(optionnel) installer le client de synchronisation fourni par | ![]() |
dans notre exemple on l'installera sous weave\firefox_sync_client |
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
RewriteBase /weave/
RewriteRule ^weave-registration-static/(.*)$ weaveserver_registration/1.0/static/index.php/$1 [QSA,L]
RewriteRule ^weave-password-reset weaveserver_registration/1.0/forgot_password.php [L]
RewriteRule ^user/1.0/(.*)$ weaveserver_registration/1.0/index.php?path=$1 [PT,QSA,L]
RewriteRule ^misc/1.0/captcha_html weaveserver_registration/1.0/captcha.php [PT,L]
RewriteRule ^1.0/(.*)$ weaveserver_sync/1.1/index.php?path=$1 [PT,L,QSA]
RewriteRule ^1.1/(.*)$ weaveserver_sync/1.1/index.php?path=$1 [PT,L,QSA]
RewriteRule ^syncclient/(.*)$ firefox_sync_client/$1 [PT,L,QSA]
case 'node':
....
/*if ($location === false|| $location == "null")
{
if (!$authdb->user_exists())
{
report_problem("No location", 404);
exit(NULL);
}
exit($location);
}*/
$location = WEAVE_MYSQL_NODE_URL;
exit($location);
function hash_password($password)
{
//return $this->generateSSHAPassword($password);
return md5($password);
}
INSERT INTO users ( id,username,md5,email,status,alert,reset)
VALUES (NULL , '<username>', MD5( <'PWD>' ) , '<email>', '1', NULL , NULL);
require_once('sync.php');
$garbage = array_shift($argv); // script name, discard
$username = array_shift($argv);
$password = array_shift($argv);
$sync_key = array_shift($argv);
$url_base = array_shift($argv);
$collection = array_shift($argv);
$sync = new Firefox_Sync($username, $password, $sync_key, $url_base);
#affiche la liste de items d'une collection par ex bookmarks
print_r($sync->collection_full($collection));