protected $rootpass = null;
protected $nickname = null;
protected $sn = null;
- protected $verbose = false;
+
+ public $verbose = false;
function __construct($domain)
{
$this->path = null;
$this->fancy = true;
+ $datanick = $this->databaseize($this->nickname);
+
$this->host = $config['DBHOSTNAME'];
- $this->database = $this->nickname.$config['DBBASE'];
+ $this->database = $datanick.$config['DBBASE'];
$this->dbtype = 'mysql'; // XXX: support others... someday
- $this->username = $this->nickname.$config['USERBASE'];
+ $this->username = $datanick.$config['USERBASE'];
+
+ // Max size for MySQL
+
+ if (strlen($this->username) > 16) {
+ $this->username = sprintf('%s%08x', substr($this->username, 0, 8), crc32($this->username));
+ }
$pwgen = $config['PWDGEN'];
function setupDatabase()
{
+ $this->updateStatus('Creating database...');
$this->createDatabase();
parent::setupDatabase();
+ $this->updateStatus('Creating file directories...');
$this->createDirectories();
+ $this->updateStatus('Saving status network...');
$this->saveStatusNetwork();
+ $this->updateStatus('Checking schema for plugins...');
$this->checkSchema();
}
$sn->dbuser = $this->username;
$sn->dbpass = $this->password;
$sn->dbname = $this->database;
+ $sn->sitename = $this->sitename;
$result = $sn->insert();
$html);
return html_entity_decode(strip_tags($breakout), ENT_QUOTES, 'UTF-8');
}
+
+ function databaseize($nickname)
+ {
+ $nickname = str_replace('-', '_', $nickname);
+ return $nickname;
+ }
}