summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/Design.php2
-rw-r--r--classes/Login_token.php42
-rw-r--r--classes/User.php24
-rw-r--r--classes/statusnet.ini1
4 files changed, 58 insertions, 11 deletions
diff --git a/classes/Design.php b/classes/Design.php
index 89ae50c8c..4e7d7dfb2 100644
--- a/classes/Design.php
+++ b/classes/Design.php
@@ -101,7 +101,7 @@ class Design extends Memcached_DataObject
}
if (0 != mb_strlen($css)) {
- $out->element('style', array('type' => 'text/css'), $css);
+ $out->style($css);
}
}
diff --git a/classes/Login_token.php b/classes/Login_token.php
new file mode 100644
index 000000000..c172b30ab
--- /dev/null
+++ b/classes/Login_token.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Table Definition for login_token
+ *
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2009, StatusNet, Inc.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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/>.
+ */
+
+if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
+
+require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
+
+class Login_token extends Memcached_DataObject
+{
+ ###START_AUTOCODE
+ /* the code below is auto generated do not remove the above tag */
+
+ public $__table = 'login_token'; // table name
+ public $user_id; // int(4) primary_key not_null
+ public $token; // char(32) not_null
+ public $created; // datetime() not_null
+ public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
+
+ /* Static get */
+ function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('Login_token',$k,$v); }
+
+ /* the code above is auto generated do not remove the tag below */
+ ###END_AUTOCODE
+}
diff --git a/classes/User.php b/classes/User.php
index f905ea2b7..2a4fab7d4 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -502,6 +502,19 @@ class User extends Memcached_DataObject
{
// Add a new block record
+ // no blocking (and thus unsubbing from) yourself
+
+ if ($this->id == $other->id) {
+ common_log(LOG_WARNING,
+ sprintf(
+ "Profile ID %d (%s) tried to block his or herself.",
+ $profile->id,
+ $profile->nickname
+ )
+ );
+ return false;
+ }
+
$block = new Profile_block();
// Begin a transaction
@@ -520,16 +533,7 @@ class User extends Memcached_DataObject
// Cancel their subscription, if it exists
- $sub = Subscription::pkeyGet(array('subscriber' => $other->id,
- 'subscribed' => $this->id));
-
- if ($sub) {
- $result = $sub->delete();
- if (!$result) {
- common_log_db_error($sub, 'DELETE', __FILE__);
- return false;
- }
- }
+ subs_unsubscribe_to($other->getUser(),$this->getProfile());
$block->query('COMMIT');
diff --git a/classes/statusnet.ini b/classes/statusnet.ini
index f12707ba1..5c942c63a 100644
--- a/classes/statusnet.ini
+++ b/classes/statusnet.ini
@@ -260,6 +260,7 @@ modified = 384
[login_token__keys]
user_id = K
+token = K
[message]
id = 129