* Copyright (C) 2011, StatusNet, Inc.
*
* One status_network per email domain
- *
+ *
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class DomainStatusNetworkPlugin extends Plugin
{
static $_thetree = null;
// For various reasons this gets squished
global $tldTree;
-
+
if (empty($tldTree)) {
if (!empty(self::$_thetree)) {
$tldTree = self::$_thetree;
'author' => 'Evan Prodromou',
'homepage' => 'http://status.net/wiki/Plugin:DomainStatusNetwork',
'rawdescription' =>
+ // TRANS: Plugin description.
_m('A plugin that maps a single status_network to an email domain.'));
return true;
}
* Copyright (C) 2011, StatusNet, Inc.
*
* Installer class for domain-based multi-homing systems
- *
+ *
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class DomainStatusNetworkInstaller extends Installer
{
protected $domain = null;
$result = $sn->insert();
if (!$result) {
- throw new ServerException("Couldn't create status_network: " . print_r($sn, true));
+ throw new ServerException("Could not create status_network: " . print_r($sn, true));
}
$sn->setTags(array('domain='.$this->domain));
$this->sn = $sn;
}
-
+
function checkSchema()
{
$config = $this->getConfig();
// Create the New DB
$res = mysql_connect($this->host, $this->rootname, $this->rootpass);
if (!$res) {
- throw new ServerException("Can't connect to {$this->host} as {$this->rootname}");
+ throw new ServerException("Cannot connect to {$this->host} as {$this->rootname}.");
}
mysql_query("CREATE DATABASE ". mysql_real_escape_string($this->database), $res);
$return = mysql_select_db($this->database, $res);
if (!$return) {
- throw new ServerException("Unable to connect to {$this->database} on {$this->host}");
+ throw new ServerException("Unable to connect to {$this->database} on {$this->host}.");
}
foreach (array('localhost', '%') as $src) {
- mysql_query("GRANT ALL ON " .
+ mysql_query("GRANT ALL ON " .
mysql_real_escape_string($this->database).".* TO '" .
$this->username . "'@'".$src."' ".
"IDENTIFIED BY '".$this->password."'", $res);
function getConfig()
{
static $config;
-
+
$cfg_file = "/etc/statusnet/setup.cfg";
if (empty($config)) {