Mass replacement of #-comments with //-comments
like leprous boils in our code. So, I've replaced all of them with // comments instead. It's a massive, meaningless, and potentially buggy change -- great one for the middle of a release cycle, eh?
This commit is contained in:
parent
61960d3668
commit
83fb5e6023
@ -54,7 +54,7 @@ class InviteAction extends CurrentUserDesignAction
|
|||||||
|
|
||||||
function sendInvitations()
|
function sendInvitations()
|
||||||
{
|
{
|
||||||
# CSRF protection
|
// CSRF protection
|
||||||
$token = $this->trimmed('token');
|
$token = $this->trimmed('token');
|
||||||
if (!$token || $token != common_session_token()) {
|
if (!$token || $token != common_session_token()) {
|
||||||
$this->showForm(_('There was a problem with your session token. Try again, please.'));
|
$this->showForm(_('There was a problem with your session token. Try again, please.'));
|
||||||
|
@ -156,7 +156,7 @@ class PasswordsettingsAction extends SettingsAction
|
|||||||
$newpassword = $this->arg('newpassword');
|
$newpassword = $this->arg('newpassword');
|
||||||
$confirm = $this->arg('confirm');
|
$confirm = $this->arg('confirm');
|
||||||
|
|
||||||
# Some validation
|
// Some validation
|
||||||
|
|
||||||
if (strlen($newpassword) < 6) {
|
if (strlen($newpassword) < 6) {
|
||||||
// TRANS: Form validation error on page where to change password.
|
// TRANS: Form validation error on page where to change password.
|
||||||
|
@ -100,7 +100,7 @@ class PublictagcloudAction extends Action
|
|||||||
|
|
||||||
function showContent()
|
function showContent()
|
||||||
{
|
{
|
||||||
# This should probably be cached rather than recalculated
|
// This should probably be cached rather than recalculated
|
||||||
$tags = new Notice_tag();
|
$tags = new Notice_tag();
|
||||||
|
|
||||||
#Need to clear the selection and then only re-add the field
|
#Need to clear the selection and then only re-add the field
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
|
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
|
||||||
|
|
||||||
# You have 24 hours to claim your password
|
// You have 24 hours to claim your password
|
||||||
|
|
||||||
define('MAX_RECOVERY_TIME', 24 * 60 * 60);
|
define('MAX_RECOVERY_TIME', 24 * 60 * 60);
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ class RecoverpasswordAction extends Action
|
|||||||
$touched = strtotime($confirm->modified);
|
$touched = strtotime($confirm->modified);
|
||||||
$email = $confirm->address;
|
$email = $confirm->address;
|
||||||
|
|
||||||
# Burn this code
|
// Burn this code
|
||||||
|
|
||||||
$result = $confirm->delete();
|
$result = $confirm->delete();
|
||||||
|
|
||||||
@ -92,8 +92,8 @@ class RecoverpasswordAction extends Action
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# These should be reaped, but for now we just check mod time
|
// These should be reaped, but for now we just check mod time
|
||||||
# Note: it's still deleted; let's avoid a second attempt!
|
// Note: it's still deleted; let's avoid a second attempt!
|
||||||
|
|
||||||
if ((time() - $touched) > MAX_RECOVERY_TIME) {
|
if ((time() - $touched) > MAX_RECOVERY_TIME) {
|
||||||
common_log(LOG_WARNING,
|
common_log(LOG_WARNING,
|
||||||
@ -105,8 +105,8 @@ class RecoverpasswordAction extends Action
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# If we used an outstanding confirmation to send the email,
|
// If we used an outstanding confirmation to send the email,
|
||||||
# it's been confirmed at this point.
|
// it's been confirmed at this point.
|
||||||
|
|
||||||
if (!$user->email) {
|
if (!$user->email) {
|
||||||
$orig = clone($user);
|
$orig = clone($user);
|
||||||
@ -120,7 +120,7 @@ class RecoverpasswordAction extends Action
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Success!
|
// Success!
|
||||||
|
|
||||||
$this->setTempUser($user);
|
$this->setTempUser($user);
|
||||||
$this->showPasswordForm();
|
$this->showPasswordForm();
|
||||||
@ -289,7 +289,7 @@ class RecoverpasswordAction extends Action
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# See if it's an unconfirmed email address
|
// See if it's an unconfirmed email address
|
||||||
|
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
// Warning: it may actually be legit to have multiple folks
|
// Warning: it may actually be legit to have multiple folks
|
||||||
@ -314,7 +314,7 @@ class RecoverpasswordAction extends Action
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Try to get an unconfirmed email address if they used a user name
|
// Try to get an unconfirmed email address if they used a user name
|
||||||
|
|
||||||
if (!$user->email && !$confirm_email) {
|
if (!$user->email && !$confirm_email) {
|
||||||
$confirm_email = new Confirm_address();
|
$confirm_email = new Confirm_address();
|
||||||
@ -332,7 +332,7 @@ class RecoverpasswordAction extends Action
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Success! We have a valid user and a confirmed or unconfirmed email address
|
// Success! We have a valid user and a confirmed or unconfirmed email address
|
||||||
|
|
||||||
$confirm = new Confirm_address();
|
$confirm = new Confirm_address();
|
||||||
$confirm->code = common_confirmation_code(128);
|
$confirm->code = common_confirmation_code(128);
|
||||||
@ -380,7 +380,7 @@ class RecoverpasswordAction extends Action
|
|||||||
|
|
||||||
function resetPassword()
|
function resetPassword()
|
||||||
{
|
{
|
||||||
# CSRF protection
|
// CSRF protection
|
||||||
$token = $this->trimmed('token');
|
$token = $this->trimmed('token');
|
||||||
if (!$token || $token != common_session_token()) {
|
if (!$token || $token != common_session_token()) {
|
||||||
// TRANS: Form validation error message.
|
// TRANS: Form validation error message.
|
||||||
@ -410,7 +410,7 @@ class RecoverpasswordAction extends Action
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# OK, we're ready to go
|
// OK, we're ready to go
|
||||||
|
|
||||||
$original = clone($user);
|
$original = clone($user);
|
||||||
|
|
||||||
|
@ -61,8 +61,8 @@ class SupAction extends Action
|
|||||||
{
|
{
|
||||||
$notice = new Notice();
|
$notice = new Notice();
|
||||||
|
|
||||||
# XXX: cache this. Depends on how big this protocol becomes;
|
// XXX: cache this. Depends on how big this protocol becomes;
|
||||||
# Re-doing this query every 15 seconds isn't the end of the world.
|
// Re-doing this query every 15 seconds isn't the end of the world.
|
||||||
|
|
||||||
$divider = common_sql_date(time() - $seconds);
|
$divider = common_sql_date(time() - $seconds);
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ class UserrssAction extends Rss10Action
|
|||||||
return ($avatar) ? $avatar->url : null;
|
return ($avatar) ? $avatar->url : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
# override parent to add X-SUP-ID URL
|
// override parent to add X-SUP-ID URL
|
||||||
|
|
||||||
function initRss($limit=0)
|
function initRss($limit=0)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ class Avatar extends Memcached_DataObject
|
|||||||
/* the code above is auto generated do not remove the tag below */
|
/* the code above is auto generated do not remove the tag below */
|
||||||
###END_AUTOCODE
|
###END_AUTOCODE
|
||||||
|
|
||||||
# We clean up the file, too
|
// We clean up the file, too
|
||||||
|
|
||||||
function delete()
|
function delete()
|
||||||
{
|
{
|
||||||
|
@ -91,7 +91,7 @@ class Foreign_link extends Memcached_DataObject
|
|||||||
$this->profilesync = 0;
|
$this->profilesync = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Convenience methods
|
// Convenience methods
|
||||||
function getForeignUser()
|
function getForeignUser()
|
||||||
{
|
{
|
||||||
$fuser = new Foreign_user();
|
$fuser = new Foreign_user();
|
||||||
|
@ -65,7 +65,7 @@ class Foreign_user extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count($parts) == 0) {
|
if (count($parts) == 0) {
|
||||||
# No changes
|
// No changes
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$toupdate = implode(', ', $parts);
|
$toupdate = implode(', ', $parts);
|
||||||
|
@ -34,7 +34,7 @@ class Memcached_DataObject extends Safe_DataObject
|
|||||||
{
|
{
|
||||||
if (is_null($v)) {
|
if (is_null($v)) {
|
||||||
$v = $k;
|
$v = $k;
|
||||||
# XXX: HACK!
|
// XXX: HACK!
|
||||||
$i = new $cls;
|
$i = new $cls;
|
||||||
$keys = $i->keys();
|
$keys = $i->keys();
|
||||||
$k = $keys[0];
|
$k = $keys[0];
|
||||||
|
@ -312,7 +312,7 @@ class Notice extends Memcached_DataObject
|
|||||||
|
|
||||||
$autosource = common_config('public', 'autosource');
|
$autosource = common_config('public', 'autosource');
|
||||||
|
|
||||||
# Sandboxed are non-false, but not 1, either
|
// Sandboxed are non-false, but not 1, either
|
||||||
|
|
||||||
if (!$profile->hasRight(Right::PUBLICNOTICE) ||
|
if (!$profile->hasRight(Right::PUBLICNOTICE) ||
|
||||||
($source && $autosource && in_array($source, $autosource))) {
|
($source && $autosource && in_array($source, $autosource))) {
|
||||||
@ -410,8 +410,8 @@ class Notice extends Memcached_DataObject
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Clear the cache for subscribed users, so they'll update at next request
|
// Clear the cache for subscribed users, so they'll update at next request
|
||||||
# XXX: someone clever could prepend instead of clearing the cache
|
// XXX: someone clever could prepend instead of clearing the cache
|
||||||
|
|
||||||
$notice->blowOnInsert();
|
$notice->blowOnInsert();
|
||||||
|
|
||||||
@ -559,8 +559,8 @@ class Notice extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# If we get here, oldest item in cache window is not
|
// If we get here, oldest item in cache window is not
|
||||||
# old enough for dupe limit; do direct check against DB
|
// old enough for dupe limit; do direct check against DB
|
||||||
$notice = new Notice();
|
$notice = new Notice();
|
||||||
$notice->profile_id = $profile_id;
|
$notice->profile_id = $profile_id;
|
||||||
$notice->content = $content;
|
$notice->content = $content;
|
||||||
@ -576,16 +576,16 @@ class Notice extends Memcached_DataObject
|
|||||||
if (empty($profile)) {
|
if (empty($profile)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
# Get the Nth notice
|
// Get the Nth notice
|
||||||
$notice = $profile->getNotices(common_config('throttle', 'count') - 1, 1);
|
$notice = $profile->getNotices(common_config('throttle', 'count') - 1, 1);
|
||||||
if ($notice && $notice->fetch()) {
|
if ($notice && $notice->fetch()) {
|
||||||
# If the Nth notice was posted less than timespan seconds ago
|
// If the Nth notice was posted less than timespan seconds ago
|
||||||
if (time() - strtotime($notice->created) <= common_config('throttle', 'timespan')) {
|
if (time() - strtotime($notice->created) <= common_config('throttle', 'timespan')) {
|
||||||
# Then we throttle
|
// Then we throttle
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# Either not N notices in the stream, OR the Nth was not posted within timespan seconds
|
// Either not N notices in the stream, OR the Nth was not posted within timespan seconds
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -695,7 +695,7 @@ class Notice extends Memcached_DataObject
|
|||||||
if (common_config('public', 'localonly')) {
|
if (common_config('public', 'localonly')) {
|
||||||
$notice->whereAdd('is_local = ' . Notice::LOCAL_PUBLIC);
|
$notice->whereAdd('is_local = ' . Notice::LOCAL_PUBLIC);
|
||||||
} else {
|
} else {
|
||||||
# -1 == blacklisted, -2 == gateway (i.e. Twitter)
|
// -1 == blacklisted, -2 == gateway (i.e. Twitter)
|
||||||
$notice->whereAdd('is_local !='. Notice::LOCAL_NONPUBLIC);
|
$notice->whereAdd('is_local !='. Notice::LOCAL_NONPUBLIC);
|
||||||
$notice->whereAdd('is_local !='. Notice::GATEWAY);
|
$notice->whereAdd('is_local !='. Notice::GATEWAY);
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ class Oauth_application_user extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count($parts) == 0) {
|
if (count($parts) == 0) {
|
||||||
# No changes
|
// No changes
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$toupdate = implode(', ', $parts);
|
$toupdate = implode(', ', $parts);
|
||||||
|
@ -93,7 +93,7 @@ class Profile extends Memcached_DataObject
|
|||||||
$avatar->url = Avatar::url($filename);
|
$avatar->url = Avatar::url($filename);
|
||||||
$avatar->created = DB_DataObject_Cast::dateTime(); # current time
|
$avatar->created = DB_DataObject_Cast::dateTime(); # current time
|
||||||
|
|
||||||
# XXX: start a transaction here
|
// XXX: start a transaction here
|
||||||
|
|
||||||
if (!$this->delete_avatars() || !$avatar->insert()) {
|
if (!$this->delete_avatars() || !$avatar->insert()) {
|
||||||
@unlink(Avatar::path($filename));
|
@unlink(Avatar::path($filename));
|
||||||
@ -101,7 +101,7 @@ class Profile extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) {
|
foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) {
|
||||||
# We don't do a scaled one if original is our scaled size
|
// We don't do a scaled one if original is our scaled size
|
||||||
if (!($avatar->width == $size && $avatar->height == $size)) {
|
if (!($avatar->width == $size && $avatar->height == $size)) {
|
||||||
$scaled_filename = $imagefile->resize($size);
|
$scaled_filename = $imagefile->resize($size);
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ class Profile_tag extends Memcached_DataObject
|
|||||||
static function getTags($tagger, $tagged) {
|
static function getTags($tagger, $tagged) {
|
||||||
$tags = array();
|
$tags = array();
|
||||||
|
|
||||||
# XXX: store this in memcached
|
// XXX: store this in memcached
|
||||||
|
|
||||||
$profile_tag = new Profile_tag();
|
$profile_tag = new Profile_tag();
|
||||||
$profile_tag->tagger = $tagger;
|
$profile_tag->tagger = $tagger;
|
||||||
@ -46,11 +46,11 @@ class Profile_tag extends Memcached_DataObject
|
|||||||
$newtags = array_unique($newtags);
|
$newtags = array_unique($newtags);
|
||||||
$oldtags = Profile_tag::getTags($tagger, $tagged);
|
$oldtags = Profile_tag::getTags($tagger, $tagged);
|
||||||
|
|
||||||
# Delete stuff that's old that not in new
|
// Delete stuff that's old that not in new
|
||||||
|
|
||||||
$to_delete = array_diff($oldtags, $newtags);
|
$to_delete = array_diff($oldtags, $newtags);
|
||||||
|
|
||||||
# Insert stuff that's in new and not in old
|
// Insert stuff that's in new and not in old
|
||||||
|
|
||||||
$to_insert = array_diff($newtags, $oldtags);
|
$to_insert = array_diff($newtags, $oldtags);
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ class Profile_tag extends Memcached_DataObject
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Return profiles with a given tag
|
// Return profiles with a given tag
|
||||||
static function getTagged($tagger, $tag) {
|
static function getTagged($tagger, $tag) {
|
||||||
$profile = new Profile();
|
$profile = new Profile();
|
||||||
$profile->query('SELECT profile.* ' .
|
$profile->query('SELECT profile.* ' .
|
||||||
|
@ -46,9 +46,9 @@ class Queue_item extends Memcached_DataObject
|
|||||||
$cnt = $qi->find(true);
|
$cnt = $qi->find(true);
|
||||||
|
|
||||||
if ($cnt) {
|
if ($cnt) {
|
||||||
# XXX: potential race condition
|
// XXX: potential race condition
|
||||||
# can we force it to only update if claimed is still null
|
// can we force it to only update if claimed is still null
|
||||||
# (or old)?
|
// (or old)?
|
||||||
common_log(LOG_INFO, 'claiming queue item id = ' . $qi->id .
|
common_log(LOG_INFO, 'claiming queue item id = ' . $qi->id .
|
||||||
' for transport ' . $qi->transport);
|
' for transport ' . $qi->transport);
|
||||||
$orig = clone($qi);
|
$orig = clone($qi);
|
||||||
|
@ -146,9 +146,9 @@ class Subscription extends Memcached_DataObject
|
|||||||
|
|
||||||
function notify()
|
function notify()
|
||||||
{
|
{
|
||||||
# XXX: add other notifications (Jabber, SMS) here
|
// XXX: add other notifications (Jabber, SMS) here
|
||||||
# XXX: queue this and handle it offline
|
// XXX: queue this and handle it offline
|
||||||
# XXX: Whatever happens, do it in Twitter-like API, too
|
// XXX: Whatever happens, do it in Twitter-like API, too
|
||||||
|
|
||||||
$this->notifyEmail();
|
$this->notifyEmail();
|
||||||
}
|
}
|
||||||
|
@ -306,11 +306,11 @@ class User_group extends Memcached_DataObject
|
|||||||
|
|
||||||
$oldaliases = $this->getAliases();
|
$oldaliases = $this->getAliases();
|
||||||
|
|
||||||
# Delete stuff that's old that not in new
|
// Delete stuff that's old that not in new
|
||||||
|
|
||||||
$to_delete = array_diff($oldaliases, $newaliases);
|
$to_delete = array_diff($oldaliases, $newaliases);
|
||||||
|
|
||||||
# Insert stuff that's in new and not in old
|
// Insert stuff that's in new and not in old
|
||||||
|
|
||||||
$to_insert = array_diff($newaliases, $oldaliases);
|
$to_insert = array_diff($newaliases, $oldaliases);
|
||||||
|
|
||||||
|
@ -292,7 +292,7 @@ class ApiAction extends Action
|
|||||||
if ($get_notice) {
|
if ($get_notice) {
|
||||||
$notice = $profile->getCurrentNotice();
|
$notice = $profile->getCurrentNotice();
|
||||||
if ($notice) {
|
if ($notice) {
|
||||||
# don't get user!
|
// don't get user!
|
||||||
$twitter_user['status'] = $this->twitterStatusArray($notice, false);
|
$twitter_user['status'] = $this->twitterStatusArray($notice, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -397,7 +397,7 @@ class ApiAction extends Action
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($include_user && $profile) {
|
if ($include_user && $profile) {
|
||||||
# Don't get notice (recursive!)
|
// Don't get notice (recursive!)
|
||||||
$twitter_user = $this->twitterUserArray($profile, false);
|
$twitter_user = $this->twitterUserArray($profile, false);
|
||||||
$twitter_status['user'] = $twitter_user;
|
$twitter_status['user'] = $twitter_user;
|
||||||
}
|
}
|
||||||
@ -698,7 +698,7 @@ class ApiAction extends Action
|
|||||||
$this->element('guid', null, $entry['guid']);
|
$this->element('guid', null, $entry['guid']);
|
||||||
$this->element('link', null, $entry['link']);
|
$this->element('link', null, $entry['link']);
|
||||||
|
|
||||||
# RSS only supports 1 enclosure per item
|
// RSS only supports 1 enclosure per item
|
||||||
if(array_key_exists('enclosures', $entry) and !empty($entry['enclosures'])){
|
if(array_key_exists('enclosures', $entry) and !empty($entry['enclosures'])){
|
||||||
$enclosure = $entry['enclosures'][0];
|
$enclosure = $entry['enclosures'][0];
|
||||||
$this->element('enclosure', array('url'=>$enclosure['url'],'type'=>$enclosure['mimetype'],'length'=>$enclosure['size']), null);
|
$this->element('enclosure', array('url'=>$enclosure['url'],'type'=>$enclosure['mimetype'],'length'=>$enclosure['size']), null);
|
||||||
@ -833,7 +833,7 @@ class ApiAction extends Action
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!is_null($suplink)) {
|
if (!is_null($suplink)) {
|
||||||
# For FriendFeed's SUP protocol
|
// For FriendFeed's SUP protocol
|
||||||
$this->element('link', array('rel' => 'http://api.friendfeed.com/2008/03#sup',
|
$this->element('link', array('rel' => 'http://api.friendfeed.com/2008/03#sup',
|
||||||
'href' => $suplink,
|
'href' => $suplink,
|
||||||
'type' => 'application/json'));
|
'type' => 'application/json'));
|
||||||
|
@ -95,9 +95,9 @@ class WebChannel extends Channel
|
|||||||
|
|
||||||
function output($user, $text)
|
function output($user, $text)
|
||||||
{
|
{
|
||||||
# XXX: buffer all output and send it at the end
|
// XXX: buffer all output and send it at the end
|
||||||
# XXX: even better, redirect to appropriate page
|
// XXX: even better, redirect to appropriate page
|
||||||
# depending on what command was run
|
// depending on what command was run
|
||||||
$this->out->startHTML();
|
$this->out->startHTML();
|
||||||
$this->out->elementStart('head');
|
$this->out->elementStart('head');
|
||||||
// TRANS: Title for command results.
|
// TRANS: Title for command results.
|
||||||
|
@ -48,7 +48,7 @@ define('NOTICE_INBOX_SOURCE_REPLY', 3);
|
|||||||
define('NOTICE_INBOX_SOURCE_FORWARD', 4);
|
define('NOTICE_INBOX_SOURCE_FORWARD', 4);
|
||||||
define('NOTICE_INBOX_SOURCE_GATEWAY', -1);
|
define('NOTICE_INBOX_SOURCE_GATEWAY', -1);
|
||||||
|
|
||||||
# append our extlib dir as the last-resort place to find libs
|
// append our extlib dir as the last-resort place to find libs
|
||||||
|
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . INSTALLDIR . '/extlib/');
|
set_include_path(get_include_path() . PATH_SEPARATOR . INSTALLDIR . '/extlib/');
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ if (!function_exists('dl')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# global configuration object
|
// global configuration object
|
||||||
|
|
||||||
require_once('PEAR.php');
|
require_once('PEAR.php');
|
||||||
require_once('PEAR/Exception.php');
|
require_once('PEAR/Exception.php');
|
||||||
|
@ -84,7 +84,7 @@ class GalleryAction extends OwnerDesignAction
|
|||||||
{
|
{
|
||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
|
|
||||||
# Post from the tag dropdown; redirect to a GET
|
// Post from the tag dropdown; redirect to a GET
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||||
common_redirect($this->selfUrl(), 303);
|
common_redirect($this->selfUrl(), 303);
|
||||||
|
@ -137,7 +137,7 @@ class GroupList extends Widget
|
|||||||
$this->out->elementEnd('p');
|
$this->out->elementEnd('p');
|
||||||
}
|
}
|
||||||
|
|
||||||
# If we're on a list with an owner (subscriptions or subscribers)...
|
// If we're on a list with an owner (subscriptions or subscribers)...
|
||||||
|
|
||||||
if (!empty($user) && !empty($this->owner) && $user->id == $this->owner->id) {
|
if (!empty($user) && !empty($this->owner) && $user->id == $this->owner->id) {
|
||||||
$this->showOwnerControls();
|
$this->showOwnerControls();
|
||||||
@ -149,8 +149,8 @@ class GroupList extends Widget
|
|||||||
$this->out->elementStart('div', 'entity_actions');
|
$this->out->elementStart('div', 'entity_actions');
|
||||||
$this->out->elementStart('ul');
|
$this->out->elementStart('ul');
|
||||||
$this->out->elementStart('li', 'entity_subscribe');
|
$this->out->elementStart('li', 'entity_subscribe');
|
||||||
# XXX: special-case for user looking at own
|
// XXX: special-case for user looking at own
|
||||||
# subscriptions page
|
// subscriptions page
|
||||||
if ($user->isMember($this->group)) {
|
if ($user->isMember($this->group)) {
|
||||||
$lf = new LeaveForm($this->out, $this->group);
|
$lf = new LeaveForm($this->out, $this->group);
|
||||||
$lf->show();
|
$lf->show();
|
||||||
|
@ -21,8 +21,8 @@ require_once(INSTALLDIR . '/lib/mail.php');
|
|||||||
require_once(INSTALLDIR . '/lib/mediafile.php');
|
require_once(INSTALLDIR . '/lib/mediafile.php');
|
||||||
require_once('Mail/mimeDecode.php');
|
require_once('Mail/mimeDecode.php');
|
||||||
|
|
||||||
# FIXME: we use both Mail_mimeDecode and mailparse
|
// FIXME: we use both Mail_mimeDecode and mailparse
|
||||||
# Need to move everything to mailparse
|
// Need to move everything to mailparse
|
||||||
|
|
||||||
class MailHandler
|
class MailHandler
|
||||||
{
|
{
|
||||||
|
@ -264,8 +264,8 @@ class StatusNetOAuthDataStore extends OAuthDataStore
|
|||||||
$profile = Profile::staticGet($remote->id);
|
$profile = Profile::staticGet($remote->id);
|
||||||
$orig_remote = clone($remote);
|
$orig_remote = clone($remote);
|
||||||
$orig_profile = clone($profile);
|
$orig_profile = clone($profile);
|
||||||
# XXX: compare current postNotice and updateProfile URLs to the ones
|
// XXX: compare current postNotice and updateProfile URLs to the ones
|
||||||
# stored in the DB to avoid (possibly...) above attack
|
// stored in the DB to avoid (possibly...) above attack
|
||||||
} else {
|
} else {
|
||||||
$exists = false;
|
$exists = false;
|
||||||
$remote = new Remote_profile();
|
$remote = new Remote_profile();
|
||||||
|
@ -24,7 +24,7 @@ function ping_broadcast_notice($notice) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Array of servers, URL => type
|
// Array of servers, URL => type
|
||||||
$notify = common_config('ping', 'notify');
|
$notify = common_config('ping', 'notify');
|
||||||
try {
|
try {
|
||||||
$profile = $notice->getProfile();
|
$profile = $notice->getProfile();
|
||||||
|
@ -34,7 +34,7 @@ define('DEFAULT_RSS_LIMIT', 48);
|
|||||||
|
|
||||||
class Rss10Action extends Action
|
class Rss10Action extends Action
|
||||||
{
|
{
|
||||||
# This will contain the details of each feed item's author and be used to generate SIOC data.
|
// This will contain the details of each feed item's author and be used to generate SIOC data.
|
||||||
|
|
||||||
var $creators = array();
|
var $creators = array();
|
||||||
var $limit = DEFAULT_RSS_LIMIT;
|
var $limit = DEFAULT_RSS_LIMIT;
|
||||||
@ -88,10 +88,10 @@ class Rss10Action extends Action
|
|||||||
if (common_config('site', 'private')) {
|
if (common_config('site', 'private')) {
|
||||||
if (!isset($_SERVER['PHP_AUTH_USER'])) {
|
if (!isset($_SERVER['PHP_AUTH_USER'])) {
|
||||||
|
|
||||||
# This header makes basic auth go
|
// This header makes basic auth go
|
||||||
header('WWW-Authenticate: Basic realm="StatusNet RSS"');
|
header('WWW-Authenticate: Basic realm="StatusNet RSS"');
|
||||||
|
|
||||||
# If the user hits cancel -- bam!
|
// If the user hits cancel -- bam!
|
||||||
$this->show_basic_auth_error();
|
$this->show_basic_auth_error();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
@ -99,7 +99,7 @@ class Rss10Action extends Action
|
|||||||
$password = $_SERVER['PHP_AUTH_PW'];
|
$password = $_SERVER['PHP_AUTH_PW'];
|
||||||
|
|
||||||
if (!common_check_user($nickname, $password)) {
|
if (!common_check_user($nickname, $password)) {
|
||||||
# basic authentication failed
|
// basic authentication failed
|
||||||
list($proxy, $ip) = common_client_ip();
|
list($proxy, $ip) = common_client_ip();
|
||||||
|
|
||||||
common_log(LOG_WARNING, "Failed RSS auth attempt, nickname = $nickname, proxy = $proxy, ip = $ip.");
|
common_log(LOG_WARNING, "Failed RSS auth attempt, nickname = $nickname, proxy = $proxy, ip = $ip.");
|
||||||
|
12
lib/util.php
12
lib/util.php
@ -2137,7 +2137,7 @@ function common_url_to_nickname($url)
|
|||||||
|
|
||||||
$parts = parse_url($url);
|
$parts = parse_url($url);
|
||||||
|
|
||||||
# If any of these parts exist, this won't work
|
// If any of these parts exist, this won't work
|
||||||
|
|
||||||
foreach ($bad as $badpart) {
|
foreach ($bad as $badpart) {
|
||||||
if (array_key_exists($badpart, $parts)) {
|
if (array_key_exists($badpart, $parts)) {
|
||||||
@ -2145,15 +2145,15 @@ function common_url_to_nickname($url)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# We just have host and/or path
|
// We just have host and/or path
|
||||||
|
|
||||||
# If it's just a host...
|
// If it's just a host...
|
||||||
if (array_key_exists('host', $parts) &&
|
if (array_key_exists('host', $parts) &&
|
||||||
(!array_key_exists('path', $parts) || strcmp($parts['path'], '/') == 0))
|
(!array_key_exists('path', $parts) || strcmp($parts['path'], '/') == 0))
|
||||||
{
|
{
|
||||||
$hostparts = explode('.', $parts['host']);
|
$hostparts = explode('.', $parts['host']);
|
||||||
|
|
||||||
# Try to catch common idiom of nickname.service.tld
|
// Try to catch common idiom of nickname.service.tld
|
||||||
|
|
||||||
if ((count($hostparts) > 2) &&
|
if ((count($hostparts) > 2) &&
|
||||||
(strlen($hostparts[count($hostparts) - 2]) > 3) && # try to skip .co.uk, .com.au
|
(strlen($hostparts[count($hostparts) - 2]) > 3) && # try to skip .co.uk, .com.au
|
||||||
@ -2161,12 +2161,12 @@ function common_url_to_nickname($url)
|
|||||||
{
|
{
|
||||||
return common_nicknamize($hostparts[0]);
|
return common_nicknamize($hostparts[0]);
|
||||||
} else {
|
} else {
|
||||||
# Do the whole hostname
|
// Do the whole hostname
|
||||||
return common_nicknamize($parts['host']);
|
return common_nicknamize($parts['host']);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (array_key_exists('path', $parts)) {
|
if (array_key_exists('path', $parts)) {
|
||||||
# Strip starting, ending slashes
|
// Strip starting, ending slashes
|
||||||
$path = preg_replace('@/$@', '', $parts['path']);
|
$path = preg_replace('@/$@', '', $parts['path']);
|
||||||
$path = preg_replace('@^/@', '', $path);
|
$path = preg_replace('@^/@', '', $path);
|
||||||
$path = basename($path);
|
$path = basename($path);
|
||||||
|
@ -45,7 +45,7 @@ class EnjitQueueHandler extends QueueHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build an Atom message from the notice
|
// Build an Atom message from the notice
|
||||||
#
|
#
|
||||||
$noticeurl = common_local_url('shownotice', array('notice' => $notice->id));
|
$noticeurl = common_local_url('shownotice', array('notice' => $notice->id));
|
||||||
$msg = $profile->nickname . ': ' . $notice->content;
|
$msg = $profile->nickname . ': ' . $notice->content;
|
||||||
@ -73,7 +73,7 @@ class EnjitQueueHandler extends QueueHandler
|
|||||||
);
|
);
|
||||||
|
|
||||||
#
|
#
|
||||||
# POST the message to $config['enjit']['apiurl']
|
// POST the message to $config['enjit']['apiurl']
|
||||||
#
|
#
|
||||||
$request = HTTPClient::start();
|
$request = HTTPClient::start();
|
||||||
$response = $request->post($url, null, $data);
|
$response = $request->post($url, null, $data);
|
||||||
|
@ -94,9 +94,9 @@ class Irc_waiting_message extends Memcached_DataObject {
|
|||||||
$cnt = $wm->find(true);
|
$cnt = $wm->find(true);
|
||||||
|
|
||||||
if ($cnt) {
|
if ($cnt) {
|
||||||
# XXX: potential race condition
|
// XXX: potential race condition
|
||||||
# can we force it to only update if claimed is still null
|
// can we force it to only update if claimed is still null
|
||||||
# (or old)?
|
// (or old)?
|
||||||
common_log(LOG_INFO, 'claiming IRC waiting message id = ' . $wm->id);
|
common_log(LOG_INFO, 'claiming IRC waiting message id = ' . $wm->id);
|
||||||
$orig = clone($wm);
|
$orig = clone($wm);
|
||||||
$wm->claimed = common_sql_now();
|
$wm->claimed = common_sql_now();
|
||||||
|
@ -100,9 +100,9 @@ class Msn_waiting_message extends Memcached_DataObject {
|
|||||||
$cnt = $wm->find(true);
|
$cnt = $wm->find(true);
|
||||||
|
|
||||||
if ($cnt) {
|
if ($cnt) {
|
||||||
# XXX: potential race condition
|
// XXX: potential race condition
|
||||||
# can we force it to only update if claimed is still null
|
// can we force it to only update if claimed is still null
|
||||||
# (or old)?
|
// (or old)?
|
||||||
common_log(LOG_INFO, 'claiming msn waiting message id = ' . $wm->id);
|
common_log(LOG_INFO, 'claiming msn waiting message id = ' . $wm->id);
|
||||||
$orig = clone($wm);
|
$orig = clone($wm);
|
||||||
$wm->claimed = common_sql_now();
|
$wm->claimed = common_sql_now();
|
||||||
|
@ -266,9 +266,9 @@ class FinishopenidloginAction extends Action
|
|||||||
|
|
||||||
if ($user) {
|
if ($user) {
|
||||||
oid_set_last($display);
|
oid_set_last($display);
|
||||||
# XXX: commented out at @edd's request until better
|
// XXX: commented out at @edd's request until better
|
||||||
# control over how data flows from OpenID provider.
|
// control over how data flows from OpenID provider.
|
||||||
# oid_update_user($user, $sreg);
|
// oid_update_user($user, $sreg);
|
||||||
common_set_user($user);
|
common_set_user($user);
|
||||||
common_real_login(true);
|
common_real_login(true);
|
||||||
if (isset($_SESSION['openid_rememberme']) && $_SESSION['openid_rememberme']) {
|
if (isset($_SESSION['openid_rememberme']) && $_SESSION['openid_rememberme']) {
|
||||||
@ -306,7 +306,7 @@ class FinishopenidloginAction extends Action
|
|||||||
|
|
||||||
function createNewUser()
|
function createNewUser()
|
||||||
{
|
{
|
||||||
# FIXME: save invite code before redirect, and check here
|
// FIXME: save invite code before redirect, and check here
|
||||||
|
|
||||||
if (!Event::handle('StartRegistrationTry', array($this))) {
|
if (!Event::handle('StartRegistrationTry', array($this))) {
|
||||||
return;
|
return;
|
||||||
@ -364,7 +364,7 @@ class FinishopenidloginAction extends Action
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Possible race condition... let's be paranoid
|
// Possible race condition... let's be paranoid
|
||||||
|
|
||||||
$other = oid_get_user($canonical);
|
$other = oid_get_user($canonical);
|
||||||
|
|
||||||
@ -379,8 +379,8 @@ class FinishopenidloginAction extends Action
|
|||||||
$location = '';
|
$location = '';
|
||||||
if (!empty($sreg['country'])) {
|
if (!empty($sreg['country'])) {
|
||||||
if ($sreg['postcode']) {
|
if ($sreg['postcode']) {
|
||||||
# XXX: use postcode to get city and region
|
// XXX: use postcode to get city and region
|
||||||
# XXX: also, store postcode somewhere -- it's valuable!
|
// XXX: also, store postcode somewhere -- it's valuable!
|
||||||
$location = $sreg['postcode'] . ', ' . $sreg['country'];
|
$location = $sreg['postcode'] . ', ' . $sreg['country'];
|
||||||
} else {
|
} else {
|
||||||
$location = $sreg['country'];
|
$location = $sreg['country'];
|
||||||
@ -395,8 +395,8 @@ class FinishopenidloginAction extends Action
|
|||||||
|
|
||||||
$email = $this->getEmail();
|
$email = $this->getEmail();
|
||||||
|
|
||||||
# XXX: add language
|
// XXX: add language
|
||||||
# XXX: add timezone
|
// XXX: add timezone
|
||||||
|
|
||||||
$args = array('nickname' => $nickname,
|
$args = array('nickname' => $nickname,
|
||||||
'email' => $email,
|
'email' => $email,
|
||||||
@ -438,7 +438,7 @@ class FinishopenidloginAction extends Action
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# They're legit!
|
// They're legit!
|
||||||
|
|
||||||
$user = User::staticGet('nickname', $nickname);
|
$user = User::staticGet('nickname', $nickname);
|
||||||
|
|
||||||
@ -477,7 +477,7 @@ class FinishopenidloginAction extends Action
|
|||||||
{
|
{
|
||||||
$url = common_get_returnto();
|
$url = common_get_returnto();
|
||||||
if ($url) {
|
if ($url) {
|
||||||
# We don't have to return to it again
|
// We don't have to return to it again
|
||||||
common_set_returnto(null);
|
common_set_returnto(null);
|
||||||
$url = common_inject_session($url);
|
$url = common_inject_session($url);
|
||||||
} else {
|
} else {
|
||||||
@ -491,7 +491,7 @@ class FinishopenidloginAction extends Action
|
|||||||
function bestNewNickname($display, $sreg)
|
function bestNewNickname($display, $sreg)
|
||||||
{
|
{
|
||||||
|
|
||||||
# Try the passed-in nickname
|
// Try the passed-in nickname
|
||||||
|
|
||||||
if (!empty($sreg['nickname'])) {
|
if (!empty($sreg['nickname'])) {
|
||||||
$nickname = $this->nicknamize($sreg['nickname']);
|
$nickname = $this->nicknamize($sreg['nickname']);
|
||||||
@ -500,7 +500,7 @@ class FinishopenidloginAction extends Action
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Try the full name
|
// Try the full name
|
||||||
|
|
||||||
if (!empty($sreg['fullname'])) {
|
if (!empty($sreg['fullname'])) {
|
||||||
$fullname = $this->nicknamize($sreg['fullname']);
|
$fullname = $this->nicknamize($sreg['fullname']);
|
||||||
@ -509,7 +509,7 @@ class FinishopenidloginAction extends Action
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Try the URL
|
// Try the URL
|
||||||
|
|
||||||
$from_url = $this->openidToNickname($display);
|
$from_url = $this->openidToNickname($display);
|
||||||
|
|
||||||
@ -517,7 +517,7 @@ class FinishopenidloginAction extends Action
|
|||||||
return $from_url;
|
return $from_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
# XXX: others?
|
// XXX: others?
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -545,10 +545,10 @@ class FinishopenidloginAction extends Action
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# We try to use an OpenID URL as a legal StatusNet user name in this order
|
// We try to use an OpenID URL as a legal StatusNet user name in this order
|
||||||
# 1. Plain hostname, like http://evanp.myopenid.com/
|
// 1. Plain hostname, like http://evanp.myopenid.com/
|
||||||
# 2. One element in path, like http://profile.typekey.com/EvanProdromou/
|
// 2. One element in path, like http://profile.typekey.com/EvanProdromou/
|
||||||
# or http://getopenid.com/evanprodromou
|
// or http://getopenid.com/evanprodromou
|
||||||
|
|
||||||
function urlToNickname($openid)
|
function urlToNickname($openid)
|
||||||
{
|
{
|
||||||
@ -562,8 +562,8 @@ class FinishopenidloginAction extends Action
|
|||||||
if (!$base) {
|
if (!$base) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
# =evan.prodromou
|
// =evan.prodromou
|
||||||
# or @gratis*evan.prodromou
|
// or @gratis*evan.prodromou
|
||||||
$parts = explode('*', substr($base, 1));
|
$parts = explode('*', substr($base, 1));
|
||||||
return $this->nicknamize(array_pop($parts));
|
return $this->nicknamize(array_pop($parts));
|
||||||
}
|
}
|
||||||
@ -578,7 +578,7 @@ class FinishopenidloginAction extends Action
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Given a string, try to make it work as a nickname
|
// Given a string, try to make it work as a nickname
|
||||||
|
|
||||||
function nicknamize($str)
|
function nicknamize($str)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ require_once('Auth/OpenID/Server.php');
|
|||||||
require_once('Auth/OpenID/SReg.php');
|
require_once('Auth/OpenID/SReg.php');
|
||||||
require_once('Auth/OpenID/MySQLStore.php');
|
require_once('Auth/OpenID/MySQLStore.php');
|
||||||
|
|
||||||
# About one year cookie expiry
|
// About one year cookie expiry
|
||||||
|
|
||||||
define('OPENID_COOKIE_EXPIRY', round(365.25 * 24 * 60 * 60));
|
define('OPENID_COOKIE_EXPIRY', round(365.25 * 24 * 60 * 60));
|
||||||
define('OPENID_COOKIE_KEY', 'lastusedopenid');
|
define('OPENID_COOKIE_KEY', 'lastusedopenid');
|
||||||
@ -36,7 +36,7 @@ function oid_store()
|
|||||||
{
|
{
|
||||||
static $store = null;
|
static $store = null;
|
||||||
if (!$store) {
|
if (!$store) {
|
||||||
# Can't be called statically
|
// Can't be called statically
|
||||||
$user = new User();
|
$user = new User();
|
||||||
$conn = $user->getDatabaseConnection();
|
$conn = $user->getDatabaseConnection();
|
||||||
$store = new Auth_OpenID_MySQLStore($conn);
|
$store = new Auth_OpenID_MySQLStore($conn);
|
||||||
@ -213,8 +213,8 @@ function oid_authenticate($openid_url, $returnto, $immediate=false)
|
|||||||
$form_html = $auth_request->formMarkup($trust_root, $process_url,
|
$form_html = $auth_request->formMarkup($trust_root, $process_url,
|
||||||
$immediate, array('id' => $form_id));
|
$immediate, array('id' => $form_id));
|
||||||
|
|
||||||
# XXX: This is cheap, but things choke if we don't escape ampersands
|
// XXX: This is cheap, but things choke if we don't escape ampersands
|
||||||
# in the HTML attributes
|
// in the HTML attributes
|
||||||
|
|
||||||
$form_html = preg_replace('/&/', '&', $form_html);
|
$form_html = preg_replace('/&/', '&', $form_html);
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ function oid_authenticate($openid_url, $returnto, $immediate=false)
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
# Half-assed attempt at a module-private function
|
// Half-assed attempt at a module-private function
|
||||||
|
|
||||||
function _oid_print_instructions()
|
function _oid_print_instructions()
|
||||||
{
|
{
|
||||||
@ -264,16 +264,16 @@ function oid_update_user($user, $sreg)
|
|||||||
|
|
||||||
if (!empty($sreg['country'])) {
|
if (!empty($sreg['country'])) {
|
||||||
if ($sreg['postcode']) {
|
if ($sreg['postcode']) {
|
||||||
# XXX: use postcode to get city and region
|
// XXX: use postcode to get city and region
|
||||||
# XXX: also, store postcode somewhere -- it's valuable!
|
// XXX: also, store postcode somewhere -- it's valuable!
|
||||||
$profile->location = $sreg['postcode'] . ', ' . $sreg['country'];
|
$profile->location = $sreg['postcode'] . ', ' . $sreg['country'];
|
||||||
} else {
|
} else {
|
||||||
$profile->location = $sreg['country'];
|
$profile->location = $sreg['country'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# XXX save language if it's passed
|
// XXX save language if it's passed
|
||||||
# XXX save timezone if it's passed
|
// XXX save timezone if it's passed
|
||||||
|
|
||||||
if (!$profile->update($orig_profile)) {
|
if (!$profile->update($orig_profile)) {
|
||||||
// TRANS: OpenID plugin server error.
|
// TRANS: OpenID plugin server error.
|
||||||
|
@ -81,7 +81,7 @@ class XmppManager extends ImManager
|
|||||||
*/
|
*/
|
||||||
public function handleInput($socket)
|
public function handleInput($socket)
|
||||||
{
|
{
|
||||||
# Process the queue for as long as needed
|
// Process the queue for as long as needed
|
||||||
try {
|
try {
|
||||||
common_log(LOG_DEBUG, "Servicing the XMPP queue.");
|
common_log(LOG_DEBUG, "Servicing the XMPP queue.");
|
||||||
$this->stats('xmpp_process');
|
$this->stats('xmpp_process');
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# Abort if called from a web server
|
// Abort if called from a web server
|
||||||
|
|
||||||
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
|
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# Abort if called from a web server
|
// Abort if called from a web server
|
||||||
|
|
||||||
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
|
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# Abort if called from a web server
|
// Abort if called from a web server
|
||||||
if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
|
if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
|
||||||
print "This script must be run from the command line\n";
|
print "This script must be run from the command line\n";
|
||||||
exit();
|
exit();
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# Abort if called from a web server
|
// Abort if called from a web server
|
||||||
if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
|
if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
|
||||||
print "This script must be run from the command line\n";
|
print "This script must be run from the command line\n";
|
||||||
exit();
|
exit();
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# Abort if called from a web server
|
// Abort if called from a web server
|
||||||
if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
|
if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
|
||||||
print "This script must be run from the command line\n";
|
print "This script must be run from the command line\n";
|
||||||
exit();
|
exit();
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# Abort if called from a web server
|
// Abort if called from a web server
|
||||||
if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
|
if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
|
||||||
print "This script must be run from the command line\n";
|
print "This script must be run from the command line\n";
|
||||||
exit();
|
exit();
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# Abort if called from a web server
|
// Abort if called from a web server
|
||||||
|
|
||||||
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
|
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# Abort if called from a web server
|
// Abort if called from a web server
|
||||||
|
|
||||||
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
|
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ if (empty($args)) {
|
|||||||
foreach ($config as $section => $section_value) {
|
foreach ($config as $section => $section_value) {
|
||||||
foreach ($section_value as $setting => $value) {
|
foreach ($section_value as $setting => $value) {
|
||||||
if (have_option('v', 'verbose') || !is_array($value)) {
|
if (have_option('v', 'verbose') || !is_array($value)) {
|
||||||
# Don't print array's without the verbose flag
|
// Don't print array's without the verbose flag
|
||||||
printf("%-20s %-20s %s\n", $section, $setting, var_export($value, true));
|
printf("%-20s %-20s %s\n", $section, $setting, var_export($value, true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ if (have_option('i', 'id')) {
|
|||||||
|
|
||||||
if (!empty($user)) {
|
if (!empty($user)) {
|
||||||
if (empty($user->email)) {
|
if (empty($user->email)) {
|
||||||
# Check for unconfirmed emails
|
// Check for unconfirmed emails
|
||||||
$unconfirmed_email = new Confirm_address();
|
$unconfirmed_email = new Confirm_address();
|
||||||
$unconfirmed_email->user_id = $user->id;
|
$unconfirmed_email->user_id = $user->id;
|
||||||
$unconfirmed_email->address_type = 'email';
|
$unconfirmed_email->address_type = 'email';
|
||||||
@ -75,7 +75,7 @@ if (have_option('e', 'email')) {
|
|||||||
$user->email = get_option_value('e', 'email');
|
$user->email = get_option_value('e', 'email');
|
||||||
$user->find(false);
|
$user->find(false);
|
||||||
if (!$user->fetch()) {
|
if (!$user->fetch()) {
|
||||||
# Check unconfirmed emails
|
// Check unconfirmed emails
|
||||||
$unconfirmed_email = new Confirm_address();
|
$unconfirmed_email = new Confirm_address();
|
||||||
$unconfirmed_email->address = $user->email;
|
$unconfirmed_email->address = $user->email;
|
||||||
$unconfirmed_email->address_type = 'email';
|
$unconfirmed_email->address_type = 'email';
|
||||||
|
Loading…
Reference in New Issue
Block a user