2008-05-08 02:15:42 +09:00
|
|
|
<?php
|
2008-05-21 04:14:12 +09:00
|
|
|
/*
|
2009-08-26 07:14:12 +09:00
|
|
|
* StatusNet - the distributed open-source microblogging tool
|
2009-08-26 07:12:20 +09:00
|
|
|
* Copyright (C) 2008, 2009, StatusNet, Inc.
|
2008-05-21 04:14:12 +09:00
|
|
|
*
|
2008-05-15 04:26:48 +09:00
|
|
|
* 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
|
|
|
|
* (at your option) any later version.
|
2008-05-21 04:14:12 +09:00
|
|
|
*
|
2008-05-15 04:26:48 +09:00
|
|
|
* 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
|
|
|
|
* GNU Affero General Public License for more details.
|
2008-05-21 04:14:12 +09:00
|
|
|
*
|
2008-05-15 04:26:48 +09:00
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2009-08-26 23:41:36 +09:00
|
|
|
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
|
2008-05-15 04:26:48 +09:00
|
|
|
|
2008-05-08 02:15:42 +09:00
|
|
|
/**
|
|
|
|
* Table Definition for remote_profile
|
|
|
|
*/
|
2008-09-27 01:18:24 +09:00
|
|
|
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
2008-05-08 02:15:42 +09:00
|
|
|
|
2011-08-23 06:52:02 +09:00
|
|
|
class Remote_profile extends Managed_DataObject
|
2008-05-08 02:15:42 +09:00
|
|
|
{
|
|
|
|
###START_AUTOCODE
|
|
|
|
/* the code below is auto generated do not remove the above tag */
|
|
|
|
|
|
|
|
public $__table = 'remote_profile'; // table name
|
|
|
|
public $id; // int(4) primary_key not_null
|
2008-05-23 03:41:09 +09:00
|
|
|
public $uri; // varchar(255) unique_key
|
2010-09-29 06:42:18 +09:00
|
|
|
public $postnoticeurl; // varchar(255)
|
|
|
|
public $updateprofileurl; // varchar(255)
|
2008-05-08 02:15:42 +09:00
|
|
|
public $created; // datetime() not_null
|
|
|
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
|
|
|
|
|
|
|
/* the code above is auto generated do not remove the tag below */
|
|
|
|
###END_AUTOCODE
|
2010-09-29 06:42:18 +09:00
|
|
|
|
2009-11-26 07:10:55 +09:00
|
|
|
function hasRight($right)
|
|
|
|
{
|
2013-08-18 20:04:58 +09:00
|
|
|
$profile = Profile::getKV($this->id);
|
2009-11-26 07:10:55 +09:00
|
|
|
if ($profile) {
|
|
|
|
return $profile->hasright($right);
|
|
|
|
} else {
|
2010-07-29 20:36:08 +09:00
|
|
|
// TRANS: Exception thrown when a right for a non-existing user profile is checked.
|
|
|
|
throw new Exception(_("Missing profile."));
|
2009-11-26 07:10:55 +09:00
|
|
|
}
|
|
|
|
}
|
2011-08-23 06:52:02 +09:00
|
|
|
|
|
|
|
public static function schemaDef()
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
'description' => 'remote people (OMB)',
|
|
|
|
'fields' => array(
|
|
|
|
'id' => array('type' => 'int', 'not null' => true, 'description' => 'foreign key to profile table'),
|
|
|
|
'uri' => array('type' => 'varchar', 'length' => 255, 'description' => 'universally unique identifier, usually a tag URI'),
|
|
|
|
'postnoticeurl' => array('type' => 'varchar', 'length' => 255, 'description' => 'URL we use for posting notices'),
|
|
|
|
'updateprofileurl' => array('type' => 'varchar', 'length' => 255, 'description' => 'URL we use for updates to this profile'),
|
|
|
|
'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('id'),
|
|
|
|
'unique keys' => array(
|
|
|
|
'remote_profile_uri_key' => array('uri'),
|
|
|
|
),
|
|
|
|
'foreign keys' => array(
|
|
|
|
'remote_profile_id_fkey' => array('profile', array('id' => 'id')),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
2008-05-08 02:15:42 +09:00
|
|
|
}
|