Commit 31d6bbf4 by Bob Mottram

Merge branch 'master' into 'bashrc/install-documentation'

# Conflicts:
#   INSTALL.md
2 parents 289d4971 432cbbd4
Showing 342 changed files with 3117 additions and 935 deletions
......@@ -227,9 +227,10 @@ sending out SMS email or XMPP messages, for off-line processing. See
* daemon (boolean, default false): Wather to use queuedaemon. False means
you'll use OpportunisticQM plugin.
* subsystem (enum["db", "stomp"], default 'db'): Which kind of queueserver to
* subsystem (enum["db", "stomp", "redis"], default 'db'): Which kind of queueserver to
use. Values include "db" for our hacked-together database queuing (no
other server required) and "stomp" for a stomp server.
other server required), "stomp" for a stomp server, and "redis" for a Redis
server.
* stomp_server (string, default null): "broker URI" for stomp server.
Something like "tcp://hostname:61613". More complicated ones are possible;
......@@ -269,6 +270,21 @@ sending out SMS email or XMPP messages, for off-line processing. See
you do), but if using another message queue server that does not support
acknowledgements you might need to disable this.
* redis_socket_location (string, default null): Unix domain socket location for
Redis. If specified, the TCP settings below be disabled.
* redis_host (string, default null): Hostname for Redis host.
* redis_port (integer, default 6379): Port number for Redis daemon.
* redis_namespace (string, default null): Prefix namespace for all Redis entries.
* redis_retries (integer, default 10): How many times a queue item will be handled
before being dropped.
* redis_expiration (integer, seconds, default: 86400/1 day): How long a queue item
will sit in Redis before being dropped.
* softlimit (integer): an absolute or relative "soft memory limit"; daemons
will restart themselves gracefully when they find they've hit this amount
of memory usage. Defaults to 90% of PHP's global memory_limit setting.
......
......@@ -38,7 +38,7 @@ run correctly.
NOTE: mod_rewrite or its equivalent is extremely useful.
Your PHP installation must include the following PHP extensions for a
functional setup of GNU Social:
functional setup of postActiv:
- openssl (compiled in for Debian, enabled manually in Arch Linux)
- php5-curl Fetching files by HTTP.
......@@ -350,7 +350,7 @@ your server (like lighttpd or nginx).
2. Assuming your webserver is properly configured and have its settings
applied (remember to reload/restart it), you can add this to your
GNU social's config.php file:
postActiv install's config.php file:
$config['site']['fancy'] = true;
You should now be able to navigate to a "fancy" URL on your server,
......@@ -386,9 +386,9 @@ your own directory.
Private
-------
A GNU social node can be configured as "private", which means it will not
A postActiv node can be configured as "private", which means it will not
federate with other nodes in the network. It is not a recommended method
of using GNU social and we cannot at the current state of development
of using postActiv and we cannot at the current state of development
guarantee that there are no leaks (what a public network sees as features,
private sites will likely see as bugs).
......@@ -402,18 +402,18 @@ Access to file attachments can also be restricted to logged-in users only:
1. Add a directory outside the web root where your file uploads will be
stored. Use this command as an initial guideline to create it:
mkdir /var/www/gnusocial-files
mkdir /var/www/postactiv-files
2. Make the file uploads directory writeable by the web server. An
insecure way to do this is (to do it properly, read up on UNIX file
permissions and configure your webserver accordingly):
chmod a+x /var/www/gnusocial-files
chmod a+x /var/www/postactiv-files
3. Tell GNU social to use this directory for file uploads. Add a line
like this to your config.php:
$config['attachments']['dir'] = '/var/www/gnusocial-files';
$config['attachments']['dir'] = '/var/www/postactiv-files';
Extra features
==============
......@@ -489,7 +489,7 @@ for translations: https://www.transifex.com/projects/p/gnu-social/
Translations use the gettext system <http://www.gnu.org/software/gettext/>.
If you for some reason do not wish to sign up to the Transifex service,
you can review the files in the "locale/" sub-directory of GNU social.
you can review the files in the "locale/" sub-directory of postActiv.
Each plugin also has its own translation files.
To get your own site to use all the translated languages, and you are
......@@ -500,13 +500,15 @@ your system and then run:
Queues and daemons
------------------
Some activities that StatusNet needs to do, like broadcast OStatus, SMS,
Some activities that postActiv needs to do, like broadcast OStatus, SMS,
XMPP messages and TwitterBridge operations, can be 'queued' and done by
off-line bots instead.
Two mechanisms are available to achieve offline operations:
* New embedded OpportunisticQM plugin, which is enabled by default
* Embedded OpportunisticQM plugin, which is enabled by default
* Redis-backed queue manager, which is the recommended option, but
requires a Redis server set up.
* Legacy queuedaemon script, which can be enabled via config file.
### OpportunisticQM plugin
......@@ -523,11 +525,58 @@ This is a good solution whether you:
* have no access to command line (shared hosting)
* do not want to deal with long-running PHP processes
* run a low traffic GNU social instance
* run a low traffic postActiv instance
In other case, you really should consider enabling the Redis queue manager or
queuedaemon for performance reasons. OpprotunisticQM is essentially the slower
option that is compatible with the most environments, but if you can run Redis
queue manager, or the queue daemons, then it is best to do so.
### Redis queue manager
If you have a Redis server available, you can use our brand-spanking-new Redis
queue manager. This uses the in-memory storage capabilities of Redis to keep the
queue in memory as much as possible and thus reduces a lot of strain on the
database which is introduced by using OpprotunisticQM or the legacy queuedaemon.
You can get Redis from https://redis.io/ and there is a Quick Install guide at
https://redis.io/topics/quickstart that can help you get it going.
In most systems, you will need three packagaes to make this work. For example,
in CentOS, you can install the required environment with:
yum install redis php-pecl-redis php-gmp
For other distributions, the package names may change.
Once Redis is set up and confirmed to be working, you will need to set the
following in your config.php:
To enable redis queue:
* queue subsystem - redis
If you have Redis running on a UNIX socket:
* redis_socket_location - the location of the UNIX socket
If you have Redis running as a web service:
* redis_host - the URL to the host
* redis_port - the TCP port Redis is operating on
There are also some optional things you can set up to tweak your queue:
* redis_namespace - you can use this to set a namespace for your queue items to
seperate them for multiple sites, or if you use Redis for somehing else as well
* redis_retries - how many times to deliver a remote message before it fails and is
dropped (default 10)
* redis_expiration - how long to hold a remote message in Redis before it is dropped
(default 86400, which is 1 day)
In other case, you really should consider enabling the queuedaemon for
performance reasons. Background daemons are necessary anyway if you wish
to use the Instant Messaging features such as communicating via XMPP.
### queuedaemon
......@@ -599,7 +648,7 @@ After installation
Backups
-------
There is no built-in system for doing backups in GNU social. You can make
There is no built-in system for doing backups in postActiv. You can make
backups of a working StatusNet system by backing up the database and
the Web directory. To backup the database use mysqldump <https://mariadb.com/kb/en/mariadb/mysqldump/>
and to backup the Web directory, try tar.
......@@ -608,5 +657,5 @@ Upgrading
---------
Upgrading is strongly recommended to stay up to date with security fixes
and new features. For instructions on how to upgrade GNU social code,
please see the UPGRADE file.
and new features. For instructions on how to upgrade postActiv code,
please see the UPGRADE file.
\ No newline at end of file
......@@ -53,7 +53,7 @@ class ApiAccountVerifyCredentialsAction extends ApiAuthAction
if (!in_array($this->format, array('xml', 'json'))) {
// TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), $code = 404);
$this->clientError(_('API method not found.'), $code = 401);
}
$twitter_user = $this->twitterUserArray($this->auth_user->getProfile(), true);
......
......@@ -64,7 +64,7 @@ class CancelsubscriptionAction extends FormAction
common_debug('Tried to cancel a non-existing pending subscription');
}
if (GNUsocial::isAjax()) {
if (postActiv::isAjax()) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
// TRANS: Title after unsubscribing from a group.
......@@ -80,4 +80,4 @@ class CancelsubscriptionAction extends FormAction
common_redirect(common_local_url('subscriptions', array('nickname' => $this->scoped->getNickname())), 303);
}
}
?>
\ No newline at end of file
?>
......@@ -133,7 +133,7 @@ class NewnoticeAction extends FormAction
$cmd = $inter->handle_command($user, $content);
if ($cmd) {
if (GNUsocial::isAjax()) {
if (postActiv::isAjax()) {
$cmd->execute(new AjaxWebChannel($this));
} else {
$cmd->execute(new WebChannel($this));
......@@ -220,7 +220,7 @@ class NewnoticeAction extends FormAction
Event::handle('EndSaveNewNoticeWeb', array($this, $user, &$content, &$options));
if (!GNUsocial::isAjax()) {
if (!postActiv::isAjax()) {
$url = common_local_url('shownotice', array('notice' => $this->stored->id));
common_redirect($url, 303);
}
......@@ -257,4 +257,4 @@ class NewnoticeAction extends FormAction
// pass
}
}
?>
\ No newline at end of file
?>
......@@ -83,7 +83,7 @@ class ShownoticeAction extends ManagedAction
{
parent::prepare($args);
if ($this->boolean('ajax')) {
GNUsocial::setApi(true);
postActiv::setApi(true);
}
$this->notice = $this->getNotice();
......@@ -264,4 +264,4 @@ class ShownoticeAction extends ManagedAction
'content' => $this->notice->content));
}
}
?>
\ No newline at end of file
?>
<?php
/***
* postActiv - a fork of the GNU Social microblogging software
* Copyright (C) 2016, Maiyannah Bishop
* Derived from code copyright various sources:
* GNU Social (C) 2013-2016, Free Software Foundation, Inc
* StatusNet (C) 2008-2011, StatusNet, Inc
/* ============================================================================
* Title: Attention
* Class to hold a notification, essentially
*
* PHP version 5
* postActiv:
* the micro-blogging software
*
* Copyright:
* Copyright (C) 2016, Maiyannah Bishop
*
* Derived from code copyright various sources:
* o GNU Social (C) 2013-2016, Free Software Foundation, Inc
* o StatusNet (C) 2008-2012, StatusNet, Inc
* ----------------------------------------------------------------------------
* License:
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
......@@ -15,75 +21,109 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Notices
* @package postActiv
* @author Mikael Nordfeldth <mmn@hethane.se>
* @author Chimo <chimo@chromic.org>
* @author Maiyannah Bishop <maiyannah.bishop@postactiv.com>
* @copyright 2014-2016 Free Software Foundation, Inc.
* @copyright 2016 Maiyannah Bishop
* @license https://www.gnu.org/licenses/agpl.html
* @link http://www.postactiv.com
* <https://www.gnu.org/licenses/agpl.html>
* ----------------------------------------------------------------------------
* About:
* Class to hold a notification, essentially
*
* PHP version:
* Tested with PHP 5.6
* ----------------------------------------------------------------------------
* File Authors:
* o Mikael Nordfeldth <mmn@hethane.se>
* o Chimo <chimo@chromic.org>
* o Maiyannah Bishop <maiyannah.bishop@postactiv.com>
*
* Web:
* o postActiv <http://www.postactiv.com>
* o GNU social <https://www.gnu.org/s/social/>
* ============================================================================
*/
// This file is formatted so that it provides useful documentation output in
// NaturalDocs. Please be considerate of this before changing formatting.
// ----------------------------------------------------------------------------
// Class: Attention
// Class abstraction to hold notifications that are not a direct reply and not
// part of the general feed.
class Attention extends Managed_DataObject
{
public $__table = 'attention'; // table name
public $notice_id; // int(4) primary_key not_null
public $profile_id; // int(4) primary_key not_null
public $reason; // varchar(191) not 255 because utf8mb4 takes more space
public $created; // datetime() not_null
public $modified; // timestamp not_null default_CURRENT_TIMESTAMP
public $__table = 'attention'; // table name
public $notice_id; // int(4) primary_key not_null
public $profile_id; // int(4) primary_key not_null
public $reason; // varchar(191) not 255 because utf8mb4 takes more space
public $created; // datetime() not_null
public $modified; // timestamp not_null default_CURRENT_TIMESTAMP
public static function schemaDef()
{
return array(
'description' => 'Notice attentions to profiles (that are not a mention and not result of a subscription)',
'fields' => array(
'notice_id' => array('type' => 'int', 'not null' => true, 'description' => 'notice_id to give attention'),
'profile_id' => array('type' => 'int', 'not null' => true, 'description' => 'profile_id for feed receiver'),
'reason' => array('type' => 'varchar', 'length' => 191, 'description' => 'Optional reason why this was brought to the attention of profile_id'),
'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
),
'primary key' => array('notice_id', 'profile_id'),
'foreign keys' => array(
'attention_notice_id_fkey' => array('notice', array('notice_id' => 'id')),
'attention_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
),
'indexes' => array(
'attention_notice_id_idx' => array('notice_id'),
'attention_profile_id_idx' => array('profile_id'),
),
);
}
// -------------------------------------------------------------------------
// Function: schemaDef
// Return the schema definition for this class
//
// Returns:
// o array
public static function schemaDef() {
return array(
'description' => 'Notice attentions to profiles (that are not a mention and not result of a subscription)',
'fields' => array(
'notice_id' => array('type' => 'int', 'not null' => true, 'description' => 'notice_id to give attention'),
'profile_id' => array('type' => 'int', 'not null' => true, 'description' => 'profile_id for feed receiver'),
'reason' => array('type' => 'varchar', 'length' => 191, 'description' => 'Optional reason why this was brought to the attention of profile_id'),
'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
),
'primary key' => array('notice_id', 'profile_id'),
'foreign keys' => array(
'attention_notice_id_fkey' => array('notice', array('notice_id' => 'id')),
'attention_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
),
'indexes' => array(
'attention_notice_id_idx' => array('notice_id'),
'attention_profile_id_idx' => array('profile_id'),
),
);
}
public static function saveNew(Notice $notice, Profile $target, $reason=null)
{
try {
$att = Attention::getByKeys(['notice_id'=>$notice->getID(), 'profile_id'=>$target->getID()]);
throw new AlreadyFulfilledException('Attention already exists with reason: '._ve($att->reason));
} catch (NoResultException $e) {
$att = new Attention();
$att->notice_id = $notice->getID();
$att->profile_id = $target->getID();
$att->reason = $reason;
$att->created = common_sql_now();
$result = $att->insert();
if ($result === false) {
throw new Exception('Failed Attention::saveNew for notice id=='.$notice->getID().' target id=='.$target->getID().', reason=="'.$reason.'"');
}
}
self::blow('attention:stream:%d', $target->getID());
return $att;
}
// -------------------------------------------------------------------------
// Function: saveNew
// Save a new attention
//
// Parameters:
// o Notice notice - the notice to make an attention for
// o Profile target - the user this is an attention for
// o string reason - the reason this is brought to their attenntion
//
// Return:
// o att - constructed attention object
public static function saveNew(Notice $notice, Profile $target, $reason=null)
{
try {
$att = Attention::getByKeys(['notice_id'=>$notice->getID(), 'profile_id'=>$target->getID()]);
throw new AlreadyFulfilledException('Attention already exists with reason: '._ve($att->reason));
} catch (NoResultException $e) {
$att = new Attention();
$att->notice_id = $notice->getID();
$att->profile_id = $target->getID();
$att->reason = $reason;
$att->created = common_sql_now();
$result = $att->insert();
if ($result === false) {
throw new Exception('Failed Attention::saveNew for notice id=='.$notice->getID().' target id=='.$target->getID().', reason=="'.$reason.'"');
}
}
self::blow('attention:stream:%d', $target->getID());
return $att;
}
}
// END OF FILE
// ============================================================================
?>
\ No newline at end of file
......@@ -29,51 +29,63 @@
* @copyright 2016 Maiyannah Bishop
* @license https://www.gnu.org/licenses/agpl.html
* @link http://www.postactiv.com
* ============================================================================
*/
// For now, since I'm doing this as a proof of concept back port
// I'm mostly concerned with seeing that this actually works.
// As such a lot is missing and a lot is hardcoded
// ----------------------------------------------------------------------------
// class SmartyTheme
// Contains the runtime abstraction and interface to a smarty-based PA theme.
// It will also contain a protected smarty instance for rendering.
public class SmartyTheme {
protected Smarty; // Smarty template system class object
var Name; // Name of template we're using
var Templates; // Array to hold template locations
var Stylesheets; // Array to hold stylesheets
var Scripts; // Array to hold scripts
class SmartyTheme {
protected $Smarty; // Smarty template system class object
var $Name; // Name of template we're using
var $Templates; // Array to hold template locations
var $Stylesheets; // Array to hold stylesheets
var $Scripts; // Array to hold scripts
public function __construct($name) {
try {
require_once(INSTALL_DIR . "/extlib/Smarty/Autoloader.php");
try
{
// Load a Smarty processor instance for this Template
require_once(INSTALLDIR . "/extlib/Smarty/Smarty.class.php");
$this->Smarty = new Smarty();
$this->Smarty->setCacheDir(INSTALLDIR . '/extlib/Smarty/cache');
$this->Name = $name;
$this->Smarty->setCacheDir(INSTALL_DIR . '/extlib/Smarty/cache');
$this->Smarty->setConfigDir(INSTALL_DIR . '/extlib/Smarty/configs');
// Populate the "Templates" array with system short_aliases
$this->instantiateTemplates();
$this->Name = $name;
require(INSTALL_DIR . "/templates/" . $this->Name . "/manifest.php");
// If we've got this far, we're good!
return TRUE;
} catch (exception $error) {
common_log("Error constructing SmartyTheme class for " . $name . ": " . $error . PHP_EOL);
return FALSE;
}
catch (exception $error)
{
die("Error constructing SmartyTheme class for " . $name . ": " . $error . PHP_EOL);
}
}
// -------------------------------------------------------------------------
// PRIVATE: instantiateTemplates()
// Populate the Templates array of this theme with the system short_aliases
private function instantiateTemplates()
{
$this->Templates["single_notice"] = "";
}
// -------------------------------------------------------------------------
// mapTemplatesDir($url)
// Public interface to set the directory the theme's Smarty instance is
// pulling templates from.
public function mapTemplatesDir($url)
{
try {
try
{
$this->Smarty->setTemplatesDir($url);
} catch (exception $error) {
common_log("Error setting the Smarty template dir: " . $error . PHP_EOL);
return TRUE;
}
catch (exception $error)
{
common_debug("Error setting the Smarty template dir: " . $error . PHP_EOL);
return FALSE;
}
}
......@@ -83,10 +95,15 @@ public class SmartyTheme {
// compiling templates to.
public function mapCompileDir($url)
{
try {
try
{
$this->Smarty->setCompileDir($url);
} catch (exception $error) {
common_log("Error setting the Smarty compile dir: " . $error . PHP_EOL);
return TRUE;
}
catch (exception $error)
{
common_debug("Error setting the Smarty compile dir: " . $error . PHP_EOL);
return FALSE;
}
}
......@@ -97,11 +114,14 @@ public class SmartyTheme {
// Returns TRUE on success, FALSE on failure.
public function mapTemplate($short_alias, $url)
{
try {
try
{
$this->Templates[$short_alias] = $url;
return TRUE;
} catch (exception $error) {
common_log("Error mapping Template in SmartyTheme::mapTemplate(" . $short_alias . "," . $url . "): " . $error . PHP_EOL);
}
catch (exception $error)
{
common_debug("Error mapping Template in SmartyTheme::mapTemplate(" . $short_alias . "," . $url . "): " . $error . PHP_EOL);
return FALSE;
}
}
......@@ -120,13 +140,15 @@ public class SmartyTheme {
if (array_key_exists($short_alias, $this->Templates))
{
return $this->Templates[$short_alias];
} else {
}
else
{
return FALSE;
}
}
catch (exception $error)
{
common_log("Error retrieving Template in SmartyTheme::retrieveTemplate(" . $short_alias . "): " . $error . PHP_EOL);
common_debug("Error retrieving Template in SmartyTheme::retrieveTemplate(" . $short_alias . "): " . $error . PHP_EOL);
return FALSE;
}
}
......@@ -141,16 +163,19 @@ public class SmartyTheme {
{
try
{
if (array_key_exists($short_alias, $this->Templates)) {
if (array_key_exists($short_alias, $this->Templates))
{
$this->Smarty->display($this->Templates[$short_alias]);
return TRUE;
} else {
}
else
{
return FALSE;
}
}
catch (exception $error)
{
common_log("Error displaying Template in SmartyTheme::displayTemplate(" . $short_alias . "): " . $error . PHP_EOL);
common_debug("Error displaying Template in SmartyTheme::displayTemplate(" . $short_alias . "): " . $error . PHP_EOL);
return FALSE;
}
}
......@@ -162,11 +187,14 @@ public class SmartyTheme {
// Returns TRUE if successful, FALSE if not.
public function assignVariable($var, $value)
{
try {
try
{
$this->Smarty->assign($var,$value);
return TRUE;
} catch {
common_log("Error assigning Smarty variables in SmartyTheme::assignVariable(" . $var . "," . $value . "): " . $error . PHP_EOL);
}
catch (exception $error)
{
common_debug("Error assigning Smarty variables in SmartyTheme::assignVariable(" . $var . "," . $value . "): " . $error . PHP_EOL);
return FALSE;
}
}
......
<?php
/* ============================================================================
* postActiv - a fork of the GNU Social microblogging software
* Title: User IM Preferences
* Class to hold a user's instant messaging preferences
*
* postActiv:
* the micro-blogging software
*
* Copyright:
* Copyright (C) 2016, Maiyannah Bishop
*
* Derived from code copyright various sources:
* GNU Social (C) 2013-2016, Free Software Foundation, Inc
* StatusNet (C) 2008-2012, StatusNet, Inc
* o GNU Social (C) 2013-2016, Free Software Foundation, Inc
* o StatusNet (C) 2008-2012, StatusNet, Inc
* ----------------------------------------------------------------------------
* License:
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
......@@ -18,27 +26,47 @@
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* <https://www.gnu.org/licenses/agpl.html>
* ----------------------------------------------------------------------------
* About:
* Data class for user IM preferences
*
* PHP version 5
* PHP version:
* Tested with PHP 5.6
* ----------------------------------------------------------------------------
* File Authors:
* o Craig Andrews <candrews@integralblue.com>
* o Brion Vibber <brion@pobox.com>
* o Evan Prodromou
* o Mikael Nordfeldth <mmn@hethane.se>
* o Maiyannah Bishop <maiyannah.bishop@postactiv.com>
*
* @category Accounts
* @package postActiv
* @author Craig Andrews <candrews@integralblue.com>
* @author Brion Vibber <brion@pobox.com>
* @author Evan Prodromou <evan@prodromou.name>
* @author Mikael Nordfeldth <mmn@hethane.se>
* @author Maiyannah Bishop <maiyannah.bishop@postactiv.com>
* @copyright 2010-2011 StatusNet, Inc.
* @copyright 2013-2016 Free Software Foundation, Inc.
* @copyright 2016 Maiyannah Bishop
* @license https://www.gnu.org/licenses/agpl.html
* @link http://www.postactiv.com/
* Web:
* o postActiv <http://www.postactiv.com>
* o GNU social <https://www.gnu.org/s/social/>
* ============================================================================
*/
// This file is formatted so that it provides useful documentation output in
// NaturalDocs. Please be considerate of this before changing formatting.
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
// -----------------------------------------------------------------------------
// Class: User_im_prefs
// Class to hold user IM preferences
//
// Variables:
// o __table
// o user_id
// o screenname
// o transport
// o notify
// o replies
// o updatefrompresence
// o created
// o modified
class User_im_prefs extends Managed_DataObject
{
###START_AUTOCODE
......@@ -57,28 +85,35 @@ class User_im_prefs extends Managed_DataObject
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
public static function schemaDef()
{
return array(
'fields' => array(
'user_id' => array('type' => 'int', 'not null' => true, 'description' => 'user'),
'screenname' => array('type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'screenname on this service'),
'transport' => array('type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'transport (ex xmpp, aim)'),
'notify' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 0, 'description' => 'Notify when a new notice is sent'),
'replies' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 0, 'description' => 'Send replies from people not subscribed to'),
'updatefrompresence' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 0, 'description' => 'Send replies from people not subscribed to.'),
'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
),
'primary key' => array('user_id', 'transport'),
'unique keys' => array(
'transport_screenname_key' => array('transport', 'screenname'),
),
'foreign keys' => array(
'user_im_prefs_user_id_fkey' => array('user', array('user_id' => 'id')),
),
);
}
// -------------------------------------------------------------------------
// Function: schemaDef
// Returns the schema definition for this class
//
// Returns:
// o array
public static function schemaDef()
{
return array(
'fields' => array(
'user_id' => array('type' => 'int', 'not null' => true, 'description' => 'user'),
'screenname' => array('type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'screenname on this service'),
'transport' => array('type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'transport (ex xmpp, aim)'),
'notify' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 0, 'description' => 'Notify when a new notice is sent'),
'replies' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 0, 'description' => 'Send replies from people not subscribed to'),
'updatefrompresence' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 0, 'description' => 'Send replies from people not subscribed to.'),
'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
),
'primary key' => array('user_id', 'transport'),
'unique keys' => array(
'transport_screenname_key' => array('transport', 'screenname'),
),
'foreign keys' => array(
'user_im_prefs_user_id_fkey' => array('user', array('user_id' => 'id')),
),
);
}
}
// END OF FILE
// ============================================================================
?>
\ No newline at end of file
<?php
/* ============================================================================
* postActiv - a fork of the GNU Social microblogging software
* Title: User Location Preferences
* Class to hold a user's location preferences
*
* postActiv:
* the micro-blogging software
*
* Copyright:
* Copyright (C) 2016, Maiyannah Bishop
*
* Derived from code copyright various sources:
* GNU Social (C) 2013-2016, Free Software Foundation, Inc
* StatusNet (C) 2008-2012, StatusNet, Inc
* o GNU Social (C) 2013-2016, Free Software Foundation, Inc
* o StatusNet (C) 2008-2012, StatusNet, Inc
* ----------------------------------------------------------------------------
* License:
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
......@@ -18,25 +26,41 @@
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* <https://www.gnu.org/licenses/agpl.html>
* ----------------------------------------------------------------------------
* About:
* Data class for user location preferences
*
* PHP version 5
* PHP version:
* Tested with PHP 5.6
* ----------------------------------------------------------------------------
* File Authors:
* o Evan Prodromou
* o Mikael Nordfeldth <mmn@hethane.se>
* o Maiyannah Bishop <maiyannah.bishop@postactiv.com>
*
* @category Geolocation
* @package postActiv
* @author Evan Prodromou <evan@status.net>
* @author Mikael Nordfeldth <mmn@hethane.se>
* @author Maiyannah Bishop <maiyannah.bishop@postactiv.com>
* @copyright 2009-2011 StatusNet, Inc.
* @copyright 2013-2016 Free Software Foundation, Inc.
* @copyright 2016 Maiyannah Bishop
* @license https://www.gnu.org/licenses/agpl.html
* @link http://www.postactiv.com/
* Web:
* o postActiv <http://www.postactiv.com>
* o GNU social <https://www.gnu.org/s/social/>
* ============================================================================
*/