summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/api.php63
-rw-r--r--actions/groupdesignsettings.php32
-rw-r--r--actions/othersettings.php11
-rw-r--r--actions/twitapifriendships.php83
-rw-r--r--actions/twitapistatuses.php15
-rw-r--r--actions/twitapiusers.php11
-rw-r--r--classes/Fave.php2
-rw-r--r--classes/User.php2
-rw-r--r--config.php.sample2
-rw-r--r--doc-src/tos300
-rw-r--r--lib/action.php5
-rw-r--r--lib/currentuserdesignaction.php12
-rw-r--r--lib/groupdesignaction.php16
-rw-r--r--lib/ownerdesignaction.php12
-rw-r--r--lib/profilelist.php20
-rw-r--r--lib/router.php4
-rw-r--r--lib/twitterapi.php61
-rw-r--r--theme/base/css/display.css24
-rw-r--r--theme/base/css/ie.css10
-rw-r--r--theme/default/css/display.css6
-rw-r--r--theme/identica/css/display.css6
21 files changed, 583 insertions, 114 deletions
diff --git a/actions/api.php b/actions/api.php
index 08f5fadad..18c3b68d4 100644
--- a/actions/api.php
+++ b/actions/api.php
@@ -75,14 +75,14 @@ class ApiAction extends Action
}
} else {
- # Caller might give us a username even if not required
- if (isset($_SERVER['PHP_AUTH_USER'])) {
- $user = User::staticGet('nickname', $_SERVER['PHP_AUTH_USER']);
- if ($user) {
- $this->user = $user;
- }
- # Twitter doesn't throw an error if the user isn't found
- }
+ // Caller might give us a username even if not required
+ if (isset($_SERVER['PHP_AUTH_USER'])) {
+ $user = User::staticGet('nickname', $_SERVER['PHP_AUTH_USER']);
+ if ($user) {
+ $this->user = $user;
+ }
+ # Twitter doesn't throw an error if the user isn't found
+ }
$this->process_command();
}
@@ -117,7 +117,7 @@ class ApiAction extends Action
}
}
- # Whitelist of API methods that don't need authentication
+ // Whitelist of API methods that don't need authentication
function requires_auth()
{
static $noauth = array( 'statuses/public_timeline',
@@ -135,28 +135,61 @@ class ApiAction extends Action
'statuses/replies',
'statuses/mentions',
'statuses/followers',
- 'favorites/favorites');
+ 'favorites/favorites',
+ 'friendships/show');
$fullname = "$this->api_action/$this->api_method";
// If the site is "private", all API methods except laconica/config
// need authentication
+
if (common_config('site', 'private')) {
return $fullname != 'laconica/config' || false;
}
+ // bareauth: only needs auth if without an argument or query param specifying user
+
if (in_array($fullname, $bareauth)) {
- # bareauth: only needs auth if without an argument or query param specifying user
- if ($this->api_arg || $this->arg('id') || is_numeric($this->arg('user_id')) || $this->arg('screen_name')) {
+
+ // Special case: friendships/show only needs auth if source_id or
+ // source_screen_name is not specified as a param
+
+ if ($fullname == 'friendships/show') {
+
+ $source_id = $this->arg('source_id');
+ $source_screen_name = $this->arg('source_screen_name');
+
+ if (empty($source_id) && empty($source_screen_name)) {
+ return true;
+ }
+
return false;
- } else {
+ }
+
+ // if all of these are empty, auth is required
+
+ $id = $this->arg('id');
+ $user_id = $this->arg('user_id');
+ $screen_name = $this->arg('screen_name');
+
+ if (empty($this->api_arg) &&
+ empty($id) &&
+ empty($user_id) &&
+ empty($screen_name)) {
return true;
+ } else {
+ return false;
}
+
} else if (in_array($fullname, $noauth)) {
- # noauth: never needs auth
+
+ // noauth: never needs auth
+
return false;
} else {
- # everybody else needs auth
+
+ // everybody else needs auth
+
return true;
}
}
diff --git a/actions/groupdesignsettings.php b/actions/groupdesignsettings.php
index 6c1c052cb..bb01243c6 100644
--- a/actions/groupdesignsettings.php
+++ b/actions/groupdesignsettings.php
@@ -312,36 +312,4 @@ class GroupDesignSettingsAction extends DesignSettingsAction
$this->showForm(_('Design preferences saved.'), true);
}
- /**
- * Handle input and output a page (overrided)
- *
- * @param array $args $_REQUEST arguments
- *
- * @return void
- */
-
- function handle($args)
- {
- parent::handle($args);
- if (!common_logged_in()) {
- $this->clientError(_('Not logged in.'));
- return;
- } else if (!common_is_real_login()) {
- // Cookie theft means that automatic logins can't
- // change important settings or see private info, and
- // _all_ our settings are important
- common_set_returnto($this->selfUrl());
- $user = common_current_user();
- if ($user->hasOpenID()) {
- common_redirect(common_local_url('openidlogin'), 303);
- } else {
- common_redirect(common_local_url('login'), 303);
- }
- } else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
- $this->handlePost();
- } else {
- $this->showForm();
- }
- }
-
}
diff --git a/actions/othersettings.php b/actions/othersettings.php
index b542233ca..1277f8052 100644
--- a/actions/othersettings.php
+++ b/actions/othersettings.php
@@ -83,14 +83,12 @@ class OthersettingsAction extends AccountSettingsAction
{
$user = common_current_user();
-
$this->elementStart('form', array('method' => 'post',
'id' => 'form_settings_other',
'class' => 'form_settings',
'action' =>
common_local_url('othersettings')));
$this->elementStart('fieldset');
- $this->element('legend', null, _('URL Auto-shortening'));
$this->hidden('token', common_session_token());
// I18N
@@ -109,10 +107,14 @@ class OthersettingsAction extends AccountSettingsAction
$this->elementStart('ul', 'form_data');
$this->elementStart('li');
- $this->dropdown('urlshorteningservice', _('Service'),
+ $this->dropdown('urlshorteningservice', _('Shorten URLs with'),
$services, _('Automatic shortening service to use.'),
false, $user->urlshorteningservice);
$this->elementEnd('li');
+ $this->elementStart('li');
+ $this->checkbox('viewdesigns', _('View profile designs'),
+ $user->viewdesigns, _('Show or hide profile designs.'));
+ $this->elementEnd('li');
$this->elementEnd('ul');
$this->submit('save', _('Save'));
$this->elementEnd('fieldset');
@@ -145,6 +147,8 @@ class OthersettingsAction extends AccountSettingsAction
return;
}
+ $viewdesigns = $this->boolean('viewdesigns');
+
$user = common_current_user();
assert(!is_null($user)); // should already be checked
@@ -154,6 +158,7 @@ class OthersettingsAction extends AccountSettingsAction
$original = clone($user);
$user->urlshorteningservice = $urlshorteningservice;
+ $user->viewdesigns = $viewdesigns;
$result = $user->update($original);
diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php
index 29eb4cc0f..5fb55e9ff 100644
--- a/actions/twitapifriendships.php
+++ b/actions/twitapifriendships.php
@@ -160,4 +160,85 @@ class TwitapifriendshipsAction extends TwitterapiAction
}
-} \ No newline at end of file
+ function show($args, $apidata)
+ {
+ parent::handle($args);
+
+ if (!in_array($apidata['content-type'], array('xml', 'json'))) {
+ $this->clientError(_('API method not found!'), $code = 404);
+ return;
+ }
+
+ $source_id = (int)$this->trimmed('source_id');
+ $source_screen_name = $this->trimmed('source_screen_name');
+
+ // If the source is not specified for an unauthenticated request,
+ // the method will return an HTTP 403.
+
+ if (empty($source_id) && empty($source_screen_name)) {
+ if (empty($apidata['user'])) {
+ $this->clientError(_('Could not determine source user.'),
+ $code = 403);
+ return;
+ }
+ }
+
+ $source = null;
+
+ if (!empty($source_id)) {
+ $source = User::staticGet($source_id);
+ } elseif (!empty($source_screen_name)) {
+ $source = User::staticGet('nickname', $source_screen_name);
+ } else {
+ $source = $apidata['user'];
+ }
+
+ // If a source or target is specified but does not exist,
+ // the method will return an HTTP 404.
+
+ if (empty($source)) {
+ $this->clientError(_('Could not determine source user.'),
+ $code = 404);
+ return;
+ }
+
+ $target_id = (int)$this->trimmed('target_id');
+ $target_screen_name = $this->trimmed('target_screen_name');
+
+ $target = null;
+
+ if (!empty($target_id)) {
+ $target = User::staticGet($target_id);
+ } elseif (!empty($target_screen_name)) {
+ $target = User::staticGet('nickname', $target_screen_name);
+ } else {
+ $this->clientError(_('Target user not specified.'),
+ $code = 403);
+ return;
+ }
+
+ if (empty($target)) {
+ $this->clientError(_('Could not find target user.'),
+ $code = 404);
+ return;
+ }
+
+ $result = $this->twitter_relationship_array($source, $target);
+
+ switch ($apidata['content-type']) {
+ case 'xml':
+ $this->init_document('xml');
+ $this->show_twitter_xml_relationship($result[relationship]);
+ $this->end_document('xml');
+ break;
+ case 'json':
+ $this->init_document('json');
+ print json_encode($result);
+ $this->end_document('json');
+ break;
+ default:
+ break;
+ }
+ }
+
+}
diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php
index 555c746cb..c9943698d 100644
--- a/actions/twitapistatuses.php
+++ b/actions/twitapistatuses.php
@@ -373,9 +373,19 @@ class TwitapistatusesAction extends TwitterapiAction
return;
}
+ // 'id' is an undocumented parameter in Twitter's API. Several
+ // clients make use of it, so we support it too.
+
+ // show.json?id=12345 takes precedence over /show/12345.json
+
$this->auth_user = $apidata['user'];
- $notice_id = $apidata['api_arg'];
- $notice = Notice::staticGet($notice_id);
+ $notice_id = $this->trimmed('id');
+
+ if (empty($notice_id)) {
+ $notice_id = $apidata['api_arg'];
+ }
+
+ $notice = Notice::staticGet((int)$notice_id);
if ($notice) {
if ($apidata['content-type'] == 'xml') {
@@ -389,7 +399,6 @@ class TwitapistatusesAction extends TwitterapiAction
$this->clientError(_('No status with that ID found.'),
404, $apidata['content-type']);
}
-
}
function destroy($args, $apidata)
diff --git a/actions/twitapiusers.php b/actions/twitapiusers.php
index 4057b63e7..e9fcccbde 100644
--- a/actions/twitapiusers.php
+++ b/actions/twitapiusers.php
@@ -37,24 +37,17 @@ class TwitapiusersAction extends TwitterapiAction
$user = null;
$email = $this->arg('email');
- $user_id = $this->arg('user_id');
// XXX: email field deprecated in Twitter's API
- // XXX: Also: need to add screen_name param
-
if ($email) {
$user = User::staticGet('email', $email);
- } elseif ($user_id) {
- $user = $this->get_user($user_id);
- } elseif (isset($apidata['api_arg'])) {
+ } else {
$user = $this->get_user($apidata['api_arg']);
- } elseif (isset($apidata['user'])) {
- $user = $apidata['user'];
}
if (empty($user)) {
- $this->client_error(_('Not found.'), 404, $apidata['content-type']);
+ $this->clientError(_('Not found.'), 404, $apidata['content-type']);
return;
}
diff --git a/classes/Fave.php b/classes/Fave.php
index f4cf6256f..c3ec62dcf 100644
--- a/classes/Fave.php
+++ b/classes/Fave.php
@@ -42,7 +42,7 @@ class Fave extends Memcached_DataObject
$ids = Notice::stream(array('Fave', '_streamDirect'),
array($user_id, $own),
($own) ? 'fave:ids_by_user_own:'.$user_id :
- 'fave:by_user:'.$user_id,
+ 'fave:ids_by_user:'.$user_id,
$offset, $limit);
return $ids;
}
diff --git a/classes/User.php b/classes/User.php
index 62a3f8a66..04b38a0d2 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -491,6 +491,8 @@ class User extends Memcached_DataObject
// ;last cache, too
$cache->delete(common_cache_key('fave:ids_by_user:'.$this->id));
$cache->delete(common_cache_key('fave:ids_by_user:'.$this->id.';last'));
+ $cache->delete(common_cache_key('fave:ids_by_user_own:'.$this->id));
+ $cache->delete(common_cache_key('fave:ids_by_user_own:'.$this->id.';last'));
}
}
diff --git a/config.php.sample b/config.php.sample
index 4f8f715be..57aa6a6c8 100644
--- a/config.php.sample
+++ b/config.php.sample
@@ -36,7 +36,7 @@ $config['site']['path'] = 'laconica';
// If you want logging sent to a file instead of syslog
// $config['site']['logfile'] = '/tmp/laconica.log';
-// Change the syslog facility that Laconica logs to
+// Change the syslog facility that Laconica logs to (default is LOG_USER)
// $config['syslog']['facility'] = LOG_LOCAL7;
// Enables extra log information, for example full details of PEAR DB errors
diff --git a/doc-src/tos b/doc-src/tos
new file mode 100644
index 000000000..bcfc31981
--- /dev/null
+++ b/doc-src/tos
@@ -0,0 +1,300 @@
+The gist
+--------
+
+We (the folks at [%%site.broughtby%%](%%site.broughtbyurl%%)) run a
+service called %%site.name%% and would love for you to use it. Our
+service is designed to give you as much control and ownership over
+what goes in your notice stream as possible and encourage you to
+express yourself freely. However, be responsible in what you post. In
+particular, make sure that none of the prohibited items listed below
+appear in your notice stream or get linked to from your notice stream (things
+like spam, viruses, or hate content).
+
+You can review our [Public Stream](%%action.public%%) to get a sense
+of the types of notices that are welcome on our service (or not!). If
+you find a %%site.name%% account that you believe violates our terms
+of service, please check our [Contact](%%doc.contact%%) documentation.
+
+(Note: Automattic, Inc., original creators of the below Terms of
+Service, decided to make them available under a Creative Commons
+Sharealike license, which means you’re more than welcome to steal it
+and repurpose it for your own use. Just make sure to replace
+references to us with ones to you. They’d appreciate a link to
+[WordPress.com](http://www.wordpress.com/) somewhere on your site.
+They spent a lot of money and time on the below, and other people
+shouldn’t need to do the same. (We didn't!))
+
+Terms of Service
+----------------
+
+The following terms and conditions govern all use of the %%site.name%%
+website and all content, services and products available at or through
+the website (taken together, the Website). The Website is owned and
+operated by %%site.broughtby%% (“Operator”). The Website is offered
+subject to your acceptance without modification of all of the terms
+and conditions contained herein and all other operating rules,
+policies (including, without limitation, Operator’s [Privacy
+Policy](%%doc.privacy%%))
+and procedures that may be published from time to time on this Site by
+Operator (collectively, the “Agreement”).
+
+Please read this Agreement carefully before accessing or using the
+Website. By accessing or using any part of the web site, you agree to
+become bound by the terms and conditions of this agreement. If you do
+not agree to all the terms and conditions of this agreement, then you
+may not access the Website or use any services. If these terms and
+conditions are considered an offer by Operator, acceptance is
+expressly limited to these terms. The Website is available only to
+individuals who are at least 13 years old.
+
+<ol>
+
+<li><strong>Your %%site.name%% Account and Site.</strong> If you
+create a notice stream on the Website, you are responsible for
+maintaining the security of your account and notice stream, and you
+are fully responsible for all activities that occur under the account
+and any other actions taken in connection with the notice stream. You
+must not describe or assign keywords to your notice stream in a
+misleading or unlawful manner, including in a manner intended to trade
+on the name or reputation of others, and Operator may change or remove
+any description or keyword that it considers inappropriate or
+unlawful, or otherwise likely to cause Operator liability. You must
+immediately notify Operator of any unauthorized uses of your notice
+stream, your account or any other breaches of security. Operator will
+not be liable for any acts or omissions by You, including any damages
+of any kind incurred as a result of such acts or omissions.</li>
+
+<li><strong>Responsibility of Contributors.</strong> If you operate a
+notice stream, comment on a notice stream, post material to the
+Website, post links on the Website, or otherwise make (or allow any
+third party to make) material available by means of the Website (any
+such material, “Content”), You are entirely responsible for the
+content of, and any harm resulting from, that Content. That is the
+case regardless of whether the Content in question constitutes text,
+graphics, an audio file, or computer software. By making Content
+available, you represent and warrant that:
+
+<ul>
+
+<li>the downloading, copying and use of the Content will not infringe
+the proprietary rights, including but not limited to the copyright,
+patent, trademark or trade secret rights, of any third party;</li>
+
+<li>if your employer has rights to intellectual property you create,
+you have either (i) received permission from your employer to post or
+make available the Content, including but not limited to any software,
+or (ii) secured from your employer a waiver as to all rights in or to
+the Content;</li>
+
+<li>you have fully complied with any third-party licenses
+relating to the Content, and have done all things necessary to
+successfully pass through to end users any required terms;</li>
+
+<li>the Content does not contain or install any viruses, worms, malware,
+Trojan horses or other harmful or destructive content;</li>
+
+<li>the Content is not spam, and does not contain unethical or
+unwanted commercial content designed to drive traffic to third party
+sites or boost the search engine rankings of third party sites, or to
+further unlawful acts (such as phishing) or mislead recipients as to
+the source of the material (such as spoofing);</li>
+
+<li>if the Content is machine- or randomly-generated, it is for
+purposes of direct entertainment, information and/or utility for you
+or other users, and not for spam,</li>
+
+<li>the Content is not libelous or defamatory (more info on
+what that means), does not contain threats or incite violence towards
+individuals or entities, and does not violate the privacy or publicity
+rights of any third party;</li>
+
+<li>your notice stream is not getting advertised via unwanted electronic
+messages such as spam links on newsgroups, email lists, other notice streams
+and web sites, and similar unsolicited promotional methods;</li>
+
+<li>your notice stream is not named in a manner that misleads your
+readers into thinking that you are another person or company. For
+example, your notice stream’s URL or name is not the name of a person other
+than yourself or company other than your own; and</li>
+
+<li>you have, in the case of Content that includes computer code,
+accurately categorized and/or described the type, nature, uses and
+effects of the materials, whether requested to do so by Operator or
+otherwise.</li>
+
+</ul>
+
+<p>By submitting Content to Operator for inclusion on your Website, you
+grant Operator a world-wide, royalty-free, and non-exclusive license
+to reproduce, modify, adapt and publish the Content solely for the
+purpose of displaying, distributing and promoting your notice
+stream.</p>
+
+<p>By submitting Content to Operator for inclusion on your Website,
+you grant all readers the right to use, re-use, modify and/or
+re-distribute the Content under the terms of the <a
+href="%%license.url%%">%%license.title%%</a>.</p>
+
+<p>If you delete Content, Operator will use reasonable efforts to remove it from
+the Website, but you acknowledge that caching or references to the
+Content may not be made immediately unavailable.</p>
+
+<p>Without limiting any of those representations or warranties, Operator
+has the right (though not the obligation) to, in Operator’s sole
+discretion (i) refuse or remove any content that, in Operator’s
+reasonable opinion, violates any Operator policy or is in any way
+harmful or objectionable, or (ii) terminate or deny access to and use
+of the Website to any individual or entity for any reason, in
+Operator’s sole discretion.</p>
+</li>
+
+<li><strong>Responsibility of Website Visitors.</strong> Operator has not reviewed,
+and cannot review, all of the material, including computer software,
+posted to the Website, and cannot therefore be responsible for that
+material’s content, use or effects. By operating the Website,
+Operator does not represent or imply that it endorses the material
+there posted, or that it believes such material to be accurate, useful
+or non-harmful. You are responsible for taking precautions as
+necessary to protect yourself and your computer systems from viruses,
+worms, Trojan horses, and other harmful or destructive content. The
+Website may contain content that is offensive, indecent, or otherwise
+objectionable, as well as content containing technical inaccuracies,
+typographical mistakes, and other errors. The Website may also contain
+material that violates the privacy or publicity rights, or infringes
+the intellectual property and other proprietary rights, of third
+parties, or the downloading, copying or use of which is subject to
+additional terms and conditions, stated or unstated. Operator
+disclaims any responsibility for any harm resulting from the use by
+visitors of the Website, or from any downloading by those visitors of
+content there posted.</li>
+
+<li><strong>Content Posted on Other Websites.</strong> We have not reviewed, and
+cannot review, all of the material, including computer software, made
+available through the websites and webpages to which %%site.name%%
+links, and that link to %%site.name%%. Operator does not have any
+control over those external websites and webpages, and is not
+responsible for their contents or their use. By linking to a
+external website or webpage, Operator does not represent or
+imply that it endorses such website or webpage. You are responsible
+for taking precautions as necessary to protect yourself and your
+computer systems from viruses, worms, Trojan horses, and other harmful
+or destructive content. Operator disclaims any responsibility for
+any harm resulting from your use of external websites and
+webpages.</li>
+
+<li><strong>Copyright Infringement and DMCA Policy.</strong> As Operator asks
+others to respect its intellectual property rights, it respects the
+intellectual property rights of others. If you believe that material
+located on or linked to by %%site.name%% violates your copyright, you
+are encouraged to notify Operator in accordance with Operator’s
+Digital Millennium Copyright Act (”DMCA”) Policy. Operator will
+respond to all such notices, including as required or appropriate by
+removing the infringing material or disabling all links to the
+infringing material. In the case of a visitor who may infringe or
+repeatedly infringes the copyrights or other intellectual property
+rights of Operator or others, Operator may, in its discretion,
+terminate or deny access to and use of the Website. In the case of
+such termination, Operator will have no obligation to provide a
+refund of any amounts previously paid to Operator.</li>
+
+<li><strong>Intellectual Property.</strong> This Agreement does not
+transfer from Operator to you any Operator or third party intellectual
+property, and all right, title and interest in and to such property
+will remain (as between the parties) solely with Operator.
+%%site.name%%, the %%site.name%% logo, and all other trademarks,
+service marks, graphics and logos used in connection with
+%%site.name%%, or the Website are trademarks or registered trademarks
+of Operator or Operator’s licensors. Other trademarks, service marks,
+graphics and logos used in connection with the Website may be the
+trademarks of other third parties. Your use of the Website grants you
+no right or license to reproduce or otherwise use any Operator or
+third-party trademarks.</li>
+
+<li><strong>Changes.</strong> Operator reserves the right, at its sole
+discretion, to modify or replace any part of this Agreement. It is
+your responsibility to check this Agreement periodically for changes.
+Your continued use of or access to the Website following the posting
+of any changes to this Agreement constitutes acceptance of those
+changes. Operator may also, in the future, offer new services and/or
+features through the Website (including, the release of new tools and
+resources). Such new features and/or services shall be subject to the
+terms and conditions of this Agreement.</li>
+
+<li><strong>Termination.</strong> Operator may terminate your access
+to all or any part of the Website at any time, with or without cause,
+with or without notice, effective immediately. If you wish to
+terminate this Agreement or your %%site.name%% account (if you have
+one), you may simply discontinue using the Website. All provisions of
+this Agreement which by their nature should survive termination shall
+survive termination, including, without limitation, ownership
+provisions, warranty disclaimers, indemnity and limitations of
+liability.</li>
+
+<li><strong>Disclaimer of Warranties.</strong> The Website is provided
+“as is”. Operator and its suppliers and licensors hereby disclaim all
+warranties of any kind, express or implied, including, without
+limitation, the warranties of merchantability, fitness for a
+particular purpose and non-infringement. Neither Operator nor its
+suppliers and licensors, makes any warranty that the Website will be
+error free or that access thereto will be continuous or uninterrupted.
+If you’re actually reading this, here’s a treat. You understand that
+you download from, or otherwise obtain content or services through,
+the Website at your own discretion and risk.</li>
+
+<li><strong>Limitation of Liability.</strong> In no event will
+Operator, or its suppliers or licensors, be liable with respect to any
+subject matter of this agreement under any contract, negligence,
+strict liability or other legal or equitable theory for: (i) any
+special, incidental or consequential damages; (ii) the cost of
+procurement or substitute products or services; (iii) for interruption
+of use or loss or corruption of data; or (iv) for any amounts that
+exceed the fees paid by you to Operator under this agreement during
+the twelve (12) month period prior to the cause of action. Operator
+shall have no liability for any failure or delay due to matters beyond
+their reasonable control. The foregoing shall not apply to the extent
+prohibited by applicable law.</li>
+
+<li><strong>General Representation and Warranty.</strong> You
+represent and warrant that (i) your use of the Website will be in
+strict accordance with the Operator Privacy Policy, with this
+Agreement and with all applicable laws and regulations (including
+without limitation any local laws or regulations in your country,
+state, city, or other governmental area, regarding online conduct and
+acceptable content, and including all applicable laws regarding the
+transmission of technical data exported from the United States or the
+country in which you reside) and (ii) your use of the Website will not
+infringe or misappropriate the intellectual property rights of any
+third party.</li>
+
+<li><strong>Indemnification.</strong> You agree to indemnify and hold
+harmless Operator, its contractors, and its licensors, and their
+respective directors, officers, employees and agents from and against
+any and all claims and expenses, including attorneys’ fees, arising
+out of your use of the Website, including but not limited to out of
+your violation this Agreement.</li>
+
+<li><strong>Miscellaneous.</strong> This Agreement constitutes the
+entire agreement between Operator and you concerning the subject
+matter hereof, and they may only be modified by a written amendment
+signed by an authorized executive of Operator, or by the posting by
+Operator of a revised version. If any part of this Agreement is held
+invalid or unenforceable, that part will be construed to reflect the
+parties’ original intent, and the remaining portions will remain in
+full force and effect. A waiver by either party of any term or
+condition of this Agreement or any breach thereof, in any one
+instance, will not waive such term or condition or any subsequent
+breach thereof. You may assign your rights under this Agreement to any
+party that consents to, and agrees to be bound by, its terms and
+conditions; Operator may assign its rights under this Agreement
+without condition. This Agreement will be binding upon and will inure
+to the benefit of the parties, their successors and permitted
+assigns.</li> </ol>
+
+*Originally published by Automattic, Inc. as the [WordPress.com Terms
+of Service](http://en.wordpress.com/tos/) and made available by them
+under the [Creative Commons Attribution-ShareAlike 3.0
+License](http://creativecommons.org/licenses/by-sa/3.0/).
+Modifications to remove reference to "VIP services", rename "blog" to
+"notice stream", remove the choice-of-venue clause, and add variables
+specific to instances of this software made by Control Yourself, Inc.
+and made available under the terms of the same license.* \ No newline at end of file
diff --git a/lib/action.php b/lib/action.php
index c89fe180a..928eb48c0 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -708,6 +708,11 @@ class Action extends HTMLOutputter // lawsuit
_('About'));
$this->menuItem(common_local_url('doc', array('title' => 'faq')),
_('FAQ'));
+ $bb = common_config('site', 'broughtby');
+ if (!empty($bb)) {
+ $this->menuItem(common_local_url('doc', array('title' => 'tos')),
+ _('TOS'));
+ }
$this->menuItem(common_local_url('doc', array('title' => 'privacy')),
_('Privacy'));
$this->menuItem(common_local_url('doc', array('title' => 'source')),
diff --git a/lib/currentuserdesignaction.php b/lib/currentuserdesignaction.php
index 7c2520cf6..4c7e15a8b 100644
--- a/lib/currentuserdesignaction.php
+++ b/lib/currentuserdesignaction.php
@@ -53,14 +53,19 @@ class CurrentUserDesignAction extends Action
*
* @return nothing
*/
+
function showStylesheets()
{
parent::showStylesheets();
- $design = $this->getDesign();
+ $user = common_current_user();
+
+ if (empty($user) || $user->viewdesigns) {
+ $design = $this->getDesign();
- if (!empty($design)) {
- $design->showCSS($this);
+ if (!empty($design)) {
+ $design->showCSS($this);
+ }
}
}
@@ -84,5 +89,4 @@ class CurrentUserDesignAction extends Action
return $cur->getDesign();
}
-
}
diff --git a/lib/groupdesignaction.php b/lib/groupdesignaction.php
index bc95921f1..58777c283 100644
--- a/lib/groupdesignaction.php
+++ b/lib/groupdesignaction.php
@@ -34,7 +34,7 @@ if (!defined('LACONICA')) {
/**
* Base class for actions that use a group's design
*
- * Pages related to groups can be themed with a design.
+ * Pages related to groups can be themed with a design.
* This superclass returns that design.
*
* @category Action
@@ -48,7 +48,7 @@ class GroupDesignAction extends Action {
/** The group in question */
var $group = null;
-
+
/**
* Show the groups's design stylesheet
*
@@ -58,10 +58,14 @@ class GroupDesignAction extends Action {
{
parent::showStylesheets();
- $design = $this->getDesign();
+ $user = common_current_user();
+
+ if (empty($user) || $user->viewdesigns) {
+ $design = $this->getDesign();
- if (!empty($design)) {
- $design->showCSS($this);
+ if (!empty($design)) {
+ $design->showCSS($this);
+ }
}
}
@@ -76,12 +80,10 @@ class GroupDesignAction extends Action {
function getDesign()
{
-
if (empty($this->group)) {
return null;
}
return $this->group->getDesign();
}
-
}
diff --git a/lib/ownerdesignaction.php b/lib/ownerdesignaction.php
index 424474f42..785b8a93d 100644
--- a/lib/ownerdesignaction.php
+++ b/lib/ownerdesignaction.php
@@ -61,11 +61,15 @@ class OwnerDesignAction extends Action {
{
parent::showStylesheets();
- $design = $this->getDesign();
+ $user = common_current_user();
- if (!empty($design)) {
- $design->showCSS($this);
- }
+ if (empty($user) || $user->viewdesigns) {
+ $design = $this->getDesign();
+
+ if (!empty($design)) {
+ $design->showCSS($this);
+ }
+ }
}
/**
diff --git a/lib/profilelist.php b/lib/profilelist.php
index e13d56a9a..774538a4b 100644
--- a/lib/profilelist.php
+++ b/lib/profilelist.php
@@ -243,20 +243,20 @@ class ProfileListItem extends Widget
$user = common_current_user();
if (!empty($user) && $this->profile->id != $user->id) {
- // Is it a local user? can't remote sub from a list
- // XXX: make that possible!
- $other = User::staticGet('id', $this->profile->id);
- if (!empty($other)) {
- $this->out->elementStart('li', 'entity_subscribe');
- if ($user->isSubscribed($this->profile)) {
- $usf = new UnsubscribeForm($this->out, $this->profile);
- $usf->show();
- } else {
+ $this->out->elementStart('li', 'entity_subscribe');
+ if ($user->isSubscribed($this->profile)) {
+ $usf = new UnsubscribeForm($this->out, $this->profile);
+ $usf->show();
+ } else {
+ // Is it a local user? can't remote sub from a list
+ // XXX: make that possible!
+ $other = User::staticGet('id', $this->profile->id);
+ if (!empty($other)) {
$sf = new SubscribeForm($this->out, $this->profile);
$sf->show();
}
- $this->out->elementEnd('li');
}
+ $this->out->elementEnd('li');
}
}
diff --git a/lib/router.php b/lib/router.php
index 784ea9882..75e72f932 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -261,7 +261,7 @@ class Router
$m->connect('api/statuses/:method',
array('action' => 'api',
'apiaction' => 'statuses'),
- array('method' => '(public_timeline|friends_timeline|user_timeline|update|replies|mentions|friends|followers|featured)(\.(atom|rss|xml|json))?'));
+ array('method' => '(public_timeline|friends_timeline|user_timeline|update|replies|mentions|show|friends|followers|featured)(\.(atom|rss|xml|json))?'));
$m->connect('api/statuses/:method/:argument',
array('action' => 'api',
@@ -317,7 +317,7 @@ class Router
$m->connect('api/friendships/:method',
array('action' => 'api',
'apiaction' => 'friendships'),
- array('method' => 'exists(\.(xml|json))'));
+ array('method' => '(show|exists)(\.(xml|json))'));
// Social graph
diff --git a/lib/twitterapi.php b/lib/twitterapi.php
index f538a0298..40e5b5067 100644
--- a/lib/twitterapi.php
+++ b/lib/twitterapi.php
@@ -278,6 +278,67 @@ class TwitterapiAction extends Action
return $twitter_dm;
}
+ function twitter_relationship_array($source, $target)
+ {
+ $relationship = array();
+
+ $relationship['source'] =
+ $this->relationship_details_array($source, $target);
+ $relationship['target'] =
+ $this->relationship_details_array($target, $source);
+
+ return array('relationship' => $relationship);
+ }
+
+ function relationship_details_array($source, $target)
+ {
+ $details = array();
+
+ $details['screen_name'] = $source->nickname;
+ $details['followed_by'] = $target->isSubscribed($source);
+ $details['following'] = $source->isSubscribed($target);
+
+ $notifications = false;
+
+ if ($source->isSubscribed($target)) {
+
+ $sub = Subscription::pkeyGet(array('subscriber' =>
+ $source->id, 'subscribed' => $target->id));
+
+ if (!empty($sub)) {
+ $notifications = ($sub->jabber || $sub->sms);
+ }
+ }
+
+ $details['notifications_enabled'] = $notifications;
+ $details['blocking'] = $source->hasBlocked($target);
+ $details['id'] = $source->id;
+
+ return $details;
+ }
+
+ function show_twitter_xml_relationship($relationship)
+ {
+ $this->elementStart('relationship');
+
+ foreach($relationship as $element => $value) {
+ if ($element == 'source' || $element == 'target') {
+ $this->elementStart($element);
+ $this->show_xml_relationship_details($value);
+ $this->elementEnd($element);
+ }
+ }
+
+ $this->elementEnd('relationship');
+ }
+
+ function show_xml_relationship_details($details)
+ {
+ foreach($details as $element => $value) {
+ $this->element($element, null, $value);
+ }
+ }
+
function show_twitter_xml_status($twitter_status)
{
$this->elementStart('status');
diff --git a/theme/base/css/display.css b/theme/base/css/display.css
index f2b200376..e9f4beaae 100644
--- a/theme/base/css/display.css
+++ b/theme/base/css/display.css
@@ -275,7 +275,7 @@ margin-bottom:18px;
#anon_notice {
float:left;
-width:43.2%;
+width:42.4%;
padding:1.1%;
border-radius:7px;
-moz-border-radius:7px;
@@ -396,7 +396,7 @@ margin-bottom:1em;
}
#content {
-width:64.009%;
+width:63.311%;
min-height:259px;
padding:1.795%;
float:left;
@@ -422,7 +422,7 @@ float:left;
width:27.917%;
min-height:259px;
float:left;
-margin-left:0.5%;
+margin-left:0.699%;
padding:1.795%;
border-radius:7px;
-moz-border-radius:7px;
@@ -432,7 +432,7 @@ border-style:solid;
}
#form_notice {
-width:45.664%;
+width:45%;
float:left;
position:relative;
line-height:1;
@@ -471,12 +471,12 @@ cursor:pointer;
}
#form_notice label[for=notice_data-attach] {
text-indent:-9999px;
-left:394px;
+left:86%;
width:16px;
height:16px;
}
#form_notice #notice_data-attach {
-left:183px;
+left:40.6%;
padding:0;
height:16px;
}
@@ -783,8 +783,8 @@ list-style-type:none;
}
.notices .notices {
margin-top:7px;
-margin-left:5%;
-width:95%;
+margin-left:2%;
+width:98%;
float:left;
}
@@ -1027,13 +1027,14 @@ border-radius:7px;
-moz-border-radius:7px;
-webkit-border-radius:7px;
}
-#jOverlayContent #content img {
-max-width:480px;
-}
#jOverlayLoading {
top:22.5%;
left:40%;
}
+#attachment_view img {
+max-width:480px;
+max-height:480px;
+}
#attachment_view #oembed_info {
margin-top:11px;
}
@@ -1278,6 +1279,7 @@ margin-bottom:0;
#form_settings_design #settings_design_background-image img {
max-width:480px;
+max-height:480px;
}
#form_settings_design #settings_design_color .form_data,
diff --git a/theme/base/css/ie.css b/theme/base/css/ie.css
index 43fb01492..3e128b84e 100644
--- a/theme/base/css/ie.css
+++ b/theme/base/css/ie.css
@@ -9,7 +9,7 @@ width:78%;
#form_notice .form_note + label {
position:absolute;
top:25px;
-left:380px;
+left:83%;
text-indent:-9999px;
height:16px;
width:16px;
@@ -25,10 +25,6 @@ width:78.5%;
#form_notice #notice_data-attach_selected button {
padding:0 4px;
}
-#anon_notice {
-max-width:39%;
-}
-
.notice-options input.submit {
font-size:0;
margin-top:3px;
@@ -49,6 +45,6 @@ z-index:1;
.notice:hover {
z-index:9999;
}
-.notice .thumbnail img {
+.notice .thumbnail img {
z-index:9999;
-} \ No newline at end of file
+}
diff --git a/theme/default/css/display.css b/theme/default/css/display.css
index 89197bddb..251d6706b 100644
--- a/theme/default/css/display.css
+++ b/theme/default/css/display.css
@@ -115,12 +115,14 @@ border-color:transparent;
background-color:#FFFFFF;
}
-#site_nav_local_views a {
-background-color:rgba(194, 194, 194, 0.5);
+#site_nav_local_views li {
box-shadow:3px 7px 5px rgba(194, 194, 194, 0.5);
-moz-box-shadow:3px 7px 5px rgba(194, 194, 194, 0.5);
-webkit-box-shadow:3px 7px 5px rgba(194, 194, 194, 0.5);
}
+#site_nav_local_views a {
+background-color:rgba(194, 194, 194, 0.5);
+}
#site_nav_local_views a:hover {
background-color:rgba(255, 255, 255, 0.7);
}
diff --git a/theme/identica/css/display.css b/theme/identica/css/display.css
index 025debf34..42a4573a7 100644
--- a/theme/identica/css/display.css
+++ b/theme/identica/css/display.css
@@ -115,12 +115,14 @@ border-color:transparent;
background-color:#FFFFFF;
}
-#site_nav_local_views a {
-background-color:rgba(194, 194, 194, 0.5);
+#site_nav_local_views li {
box-shadow:3px 7px 5px rgba(194, 194, 194, 0.5);
-moz-box-shadow:3px 7px 5px rgba(194, 194, 194, 0.5);
-webkit-box-shadow:3px 7px 5px rgba(194, 194, 194, 0.5);
}
+#site_nav_local_views a {
+background-color:rgba(194, 194, 194, 0.5);
+}
#site_nav_local_views a:hover {
background-color:rgba(255, 255, 255, 0.7);
}