diff options
-rw-r--r-- | actions/twitterauthorization.php | 25 | ||||
-rw-r--r-- | classes/Foreign_link.php | 1 | ||||
-rw-r--r-- | classes/laconica.ini | 1 | ||||
-rw-r--r-- | db/laconica.sql | 3 | ||||
-rw-r--r-- | lib/common.php | 2 | ||||
-rw-r--r-- | lib/mail.php | 4 | ||||
-rw-r--r-- | lib/twitter.php | 60 | ||||
-rwxr-xr-x | scripts/twitterstatusfetcher.php | 4 |
8 files changed, 73 insertions, 27 deletions
diff --git a/actions/twitterauthorization.php b/actions/twitterauthorization.php index b04f35327..866e3a1e7 100644 --- a/actions/twitterauthorization.php +++ b/actions/twitterauthorization.php @@ -19,7 +19,7 @@ * 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/>. * - * @category Twitter + * @category TwitterauthorizationAction * @package Laconica * @author Zach Copely <zach@controlyourself.ca> * @copyright 2009 Control Yourself, Inc. @@ -31,30 +31,9 @@ if (!defined('LACONICA')) { exit(1); } -/** - * Class for doing OAuth authentication against Twitter - * - * Peforms the OAuth "dance" between Laconica and Twitter -- requests a token, - * authorizes it, and exchanges it for an access token. It also creates a link - * (Foreign_link) between the Laconica user and Twitter user and stores the - * access token and secret in the link. - * - * @category Twitter - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ - * - */ class TwitterauthorizationAction extends Action { - /** - * Initialize class members. Looks for 'oauth_token' parameter. - * - * @param array $args misc. arguments - * - * @return boolean true - */ + function prepare($args) { parent::prepare($args); diff --git a/classes/Foreign_link.php b/classes/Foreign_link.php index ae8c22fd8..bc3ab006d 100644 --- a/classes/Foreign_link.php +++ b/classes/Foreign_link.php @@ -14,6 +14,7 @@ class Foreign_link extends Memcached_DataObject public $foreign_id; // bigint(8) primary_key not_null unsigned public $service; // int(4) primary_key not_null public $credentials; // varchar(255) + public $token; // varchar(255) public $noticesync; // tinyint(1) not_null default_1 public $friendsync; // tinyint(1) not_null default_2 public $profilesync; // tinyint(1) not_null default_1 diff --git a/classes/laconica.ini b/classes/laconica.ini index 766bed75d..85d5f528d 100644 --- a/classes/laconica.ini +++ b/classes/laconica.ini @@ -127,6 +127,7 @@ user_id = 129 foreign_id = 129 service = 129 credentials = 2 +token = 2 noticesync = 145 friendsync = 145 profilesync = 145 diff --git a/db/laconica.sql b/db/laconica.sql index 2c04f680a..8b1152cbd 100644 --- a/db/laconica.sql +++ b/db/laconica.sql @@ -291,7 +291,8 @@ create table foreign_link ( user_id int comment 'link to user on this system, if exists' references user (id), foreign_id bigint unsigned comment 'link to user on foreign service, if exists' references foreign_user(id), service int not null comment 'foreign key to service' references foreign_service(id), - credentials varchar(255) comment 'authc credentials, typically a password', + credentials varchar(255) comment 'auth credentials, typically a password or token secret', + token varchar(255) comment 'access token', noticesync tinyint not null default 1 comment 'notice synchronization, bit 1 = sync outgoing, bit 2 = sync incoming, bit 3 = filter local replies', friendsync tinyint not null default 2 comment 'friend synchronization, bit 1 = sync outgoing, bit 2 = sync incoming', profilesync tinyint not null default 1 comment 'profile synchronization, bit 1 = sync outgoing, bit 2 = sync incoming', diff --git a/lib/common.php b/lib/common.php index 72c093bf3..8d79b2666 100644 --- a/lib/common.php +++ b/lib/common.php @@ -19,7 +19,7 @@ if (!defined('LACONICA')) { exit(1); } -define('LACONICA_VERSION', '0.8.1dev'); +define('LACONICA_VERSION', '0.8.1pre1'); define('AVATAR_PROFILE_SIZE', 96); define('AVATAR_STREAM_SIZE', 48); diff --git a/lib/mail.php b/lib/mail.php index 2e471fd6d..33d1eb754 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -692,11 +692,11 @@ function mail_facebook_app_removed($user) $site_name = common_config('site', 'name'); $subject = sprintf( - _('Your %1\$s Facebook application access has been disabled.', + _('Your %1$s Facebook application access has been disabled.', $site_name)); $body = sprintf(_("Hi, %1\$s. We're sorry to inform you that we are " . - 'unable to update your Facebook status from %2\$s, and have disabled ' . + 'unable to update your Facebook status from %2$s, and have disabled ' . 'the Facebook application for your account. This may be because ' . 'you have removed the Facebook application\'s authorization, or ' . 'have deleted your Facebook account. You can re-enable the ' . diff --git a/lib/twitter.php b/lib/twitter.php index 280cdb0a3..11c137428 100644 --- a/lib/twitter.php +++ b/lib/twitter.php @@ -256,3 +256,63 @@ function remove_twitter_link($flink) } + $result = mail_twitter_bridge_removed($user); + + if (!$result) { + + $msg = 'Unable to send email to notify ' . + "$user->nickname (user id: $user->id) " . + 'that their Twitter bridge link was ' . + 'removed!'; + + common_log(LOG_WARNING, $msg); + } + } + +} + + $result = mail_twitter_bridge_removed($user); + + if (!$result) { + + $msg = 'Unable to send email to notify ' . + "$user->nickname (user id: $user->id) " . + 'that their Twitter bridge link was ' . + 'removed!'; + + common_log(LOG_WARNING, $msg); + } + } + +} + + $result = mail_twitter_bridge_removed($user); + + if (!$result) { + + $msg = 'Unable to send email to notify ' . + "$user->nickname (user id: $user->id) " . + 'that their Twitter bridge link was ' . + 'removed!'; + + common_log(LOG_WARNING, $msg); + } + } + +} + + $result = mail_twitter_bridge_removed($user); + + if (!$result) { + + $msg = 'Unable to send email to notify ' . + "$user->nickname (user id: $user->id) " . + 'that their Twitter bridge link was ' . + 'removed!'; + + common_log(LOG_WARNING, $msg); + } + } + +} + diff --git a/scripts/twitterstatusfetcher.php b/scripts/twitterstatusfetcher.php index f5289c5f4..082bcc962 100755 --- a/scripts/twitterstatusfetcher.php +++ b/scripts/twitterstatusfetcher.php @@ -97,6 +97,10 @@ class TwitterStatusFetcher extends ParallelizingDaemon { global $_DB_DATAOBJECT; +======= + global $_DB_DATAOBJECT; + +>>>>>>> 0.8.x:scripts/twitterstatusfetcher.php $flink = new Foreign_link(); $conn = &$flink->getDatabaseConnection(); |