/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
- static $cache = null;
- static $cacheInitialized = false;
+ // XXX: made public so Status_network_tag can eff with it
+ public static $cache = null;
+ public static $cacheInitialized = false;
static $base = null;
static $wildcard = null;
// or a single-process script which is switching
// configurations.
$persist = php_sapi_name() != 'cli' || self::$cacheInitialized;
- if (is_array($servers)) {
- foreach($servers as $server) {
- self::$cache->addServer($server, 11211, $persist);
+ if (!is_array($servers)) {
+ $servers = array($servers);
+ }
+ foreach($servers as $server) {
+ $parts = explode(':', $server);
+ $server = $parts[0];
+ if (count($parts) > 1) {
+ $port = $parts[1];
+ } else {
+ $port = 11211;
}
- } else {
- self::$cache->addServer($servers, 11211, $persist);
+ self::$cache->addServer($server, $port, $persist);
}
self::$cacheInitialized = true;
}
function decache()
{
$key = 'status_network_tags:' . $this->site_id;
- if (Status_network::$cache) {
- Status_network::$cache->delete($key);
+ if (Status_network::$cache || Status_network::$cacheInitialized) {
+ // FIXME: this was causing errors, so I'm hiding them.
+ // I'm a big chicken and lazy.
+ @Status_network::$cache->delete($key);
}
}
__FILE__);
$success = mail_send_sms_notice_address($notice,
$user->smsemail,
- $user->incomingemail);
+ $user->incomingemail,
+ $user->nickname);
if (!$success) {
// XXX: Not sure, but I think that's the right thing to do
common_log(LOG_WARNING,
{
return mail_send_sms_notice_address($notice,
$user->smsemail,
- $user->incomingemail);
+ $user->incomingemail,
+ $user->nickname);
}
/**
* @param Notice $notice notice to send
* @param string $smsemail email address to send to
* @param string $incomingemail email address to set as 'from'
+ * @param string $nickname nickname to add to beginning
*
* @return boolean success flag
*/
-function mail_send_sms_notice_address($notice, $smsemail, $incomingemail)
+function mail_send_sms_notice_address($notice, $smsemail, $incomingemail, $nickname)
{
$to = $nickname . ' <' . $smsemail . '>';
include_once $dir . '/actions/' . strtolower(mb_substr($cls, 0, -6)) . '.php';
return false;
case 'DomainStatusNetworkInstaller':
- include_once $dir . '/lib/' . strtolower($cls) . '.php';
- return false;
case 'GlobalApiAction':
+ case 'FreeEmail':
include_once $dir . '/lib/' . strtolower($cls) . '.php';
return false;
default:
{
$domain = self::toDomain($email);
+ if (FreeEmail::isFree($domain)) {
+ throw new ClientException(_("Use your work email."));
+ }
+
$sn = self::siteForDomain($domain);
if (empty($sn)) {
--- /dev/null
+<?php
+
+class FreeEmail {
+
+ static $domains =
+ array('111mail.com',
+ '123iran.com',
+ '1-usa.com',
+ '2die4.com',
+ '37.com',
+ '420email.com',
+ '4degreez.com',
+ '4-music-today.com',
+ '5.am',
+ '5005.lv',
+ '8.am',
+ 'a.org.ua',
+ 'abha.cc',
+ 'accountant.com',
+ 'actingbiz.com',
+ 'adexec.com',
+ 'africamail.com',
+ 'agadir.cc',
+ 'ahsa.ws',
+ 'ajman.cc',
+ 'ajman.us',
+ 'ajman.ws',
+ 'albaha.cc',
+ 'alex4all.com',
+ 'alexandria.cc',
+ 'algerie.cc',
+ 'allergist.com',
+ 'allhiphop.com',
+ 'alriyadh.cc',
+ 'alumnidirector.com',
+ 'amman.cc',
+ 'anatomicrock.com',
+ 'animeone.com',
+ 'anjungcafe.com',
+ 'aqaba.cc',
+ 'arar.ws',
+ 'archaeologist.com',
+ 'arcticmail.com',
+ 'artlover.com',
+ 'asia.com',
+ 'asiancutes.com',
+ 'aswan.cc',
+ 'a-teens.net',
+ 'ausi.com',
+ 'australiamail.com',
+ 'autoindia.com',
+ 'autopm.com',
+ 'baalbeck.cc',
+ 'bahraini.cc',
+ 'banha.cc',
+ 'barriolife.com',
+ 'b-boy.com',
+ 'beautifulboy.com',
+ 'berlin.com',
+ 'bgay.com',
+ 'bicycledata.com',
+ 'bicycling.com',
+ 'bigheavyworld.com',
+ 'bigmailbox.net',
+ 'bikerheaven.net',
+ 'bikerider.com',
+ 'bikermail.com',
+ 'billssite.com',
+ 'bizerte.cc',
+ 'bk.ru',
+ 'blackandchristian.com',
+ 'blackcity.net',
+ 'blackvault.com',
+ 'blida.info',
+ 'bmx.lv',
+ 'bmxtrix.com',
+ 'boarderzone.com',
+ 'boatnerd.com',
+ 'bolbox.com',
+ 'bongmail.com',
+ 'bowl.com',
+ 'buraydah.cc',
+ 'butch-femme.org',
+ 'byke.com',
+ 'calle22.com',
+ 'cameroon.cc',
+ 'cannabismail.com',
+ 'catlover.com',
+ 'catlovers.com',
+ 'certifiedbitches.com',
+ 'championboxing.com',
+ 'chatway.com',
+ 'cheerful.com',
+ 'chemist.com',
+ 'chillymail.com',
+ 'classprod.com',
+ 'classycouples.com',
+ 'clerk.com',
+ 'cliffhanger.com',
+ 'columnist.com',
+ 'comic.com',
+ 'company.org.ua',
+ 'congiu.net',
+ 'consultant.com',
+ 'coolmail.ru',
+ 'coolshit.com',
+ 'corpusmail.com',
+ 'counsellor.com',
+ 'cutey.com',
+ 'cyberunlimited.org',
+ 'cycledata.com',
+ 'darkfear.com',
+ 'darkforces.com',
+ 'deliveryman.com',
+ 'dhahran.cc',
+ 'dhofar.cc',
+ 'dino.lv',
+ 'diplomats.com',
+ 'dirtythird.com',
+ 'djibouti.cc',
+ 'doctor.com',
+ 'doglover.com',
+ 'dominican.cc',
+ 'dopefiends.com',
+ 'dr.com',
+ 'draac.com',
+ 'drakmail.net',
+ 'dr-dre.com',
+ 'dreamstop.com',
+ 'dublin.com',
+ 'earthling.net',
+ 'earthling.net',
+ 'eclub.lv',
+ 'egypt.net',
+ 'e-mail.am',
+ 'email.com',
+ 'e-mail.ru',
+ 'emailfast.com',
+ 'emails.ru',
+ 'e-mails.ru',
+ 'eminemfans .com',
+ 'envirocitizen.com',
+ 'eritrea.cc',
+ 'eritrea.cc',
+ 'escapeartist.com',
+ 'europe.com',
+ 'execs.com',
+ 'ezsweeps.com',
+ 'falasteen.cc',
+ 'famous.as',
+ 'farts.com',
+ 'feelingnaughty.com',
+ 'financier.com',
+ 'firemyst.com',
+ 'fit.lv',
+ 'freeonline.com',
+ 'fromru.com',
+ 'front.ru',
+ 'fudge.com',
+ 'fujairah.cc',
+ 'fujairah.us',
+ 'fujairah.ws',
+ 'funkytimes.com',
+ 'gabes.cc',
+ 'gafsa.cc',
+ 'gala.net',
+ 'gamerssolution.com',
+ 'gardener.com',
+ 'gawab.com',
+ 'gazabo.net',
+ 'geologist.com',
+ 'giza.cc',
+ 'glittergrrrls.com',
+ 'gmail.com',
+ 'goatrance.com',
+ 'goddess.com',
+ 'gohip.com',
+ 'goldenmail.ru',
+ 'goldmail.ru',
+ 'gospelcity.com',
+ 'gothicgirl.com',
+ 'gotomy.com',
+ 'grapemail.net',
+ 'graphic-designer.com',
+ 'greatautos.org',
+ 'guinea.cc',
+ 'guinea.cc',
+ 'guy.com',
+ 'hacker.am',
+ 'hairdresser.net',
+ 'haitisurf.com',
+ 'hamra.cc',
+ 'happyhippo.com',
+ 'hasakah.com',
+ 'hateinthebox.com',
+ 'hebron.tv',
+ 'hip hopmail.com',
+ 'homs.cc',
+ 'hotbox.ru',
+ 'hotmail.com',
+ 'hotmail.ru',
+ 'hot-shot.com',
+ 'houseofhorrors.com',
+ 'hugkiss.com',
+ 'hullnumber.com',
+ 'human.lv',
+ 'ibra.cc',
+ 'idunno4recipes.com',
+ 'ihatenetscape.com',
+ 'iname.com',
+ 'inbox.ru',
+ 'inorbit.com',
+ 'insurer.com',
+ 'intimatefire.com',
+ 'iphon.biz',
+ 'irbid.ws',
+ 'irow.com',
+ 'ismailia.cc',
+ 'jadida.cc',
+ 'jadida.org',
+ 'japan.com',
+ 'jazzemail.com',
+ 'jerash.cc',
+ 'jizan.cc',
+ 'jouf.cc',
+ 'journalist.com',
+ 'juanitabynum.com',
+ 'kairouan.cc',
+ 'kanoodle.com',
+ 'karak.cc',
+ 'khaimah.cc',
+ 'khartoum.cc',
+ 'khobar.cc',
+ 'kickboxing.com',
+ 'kidrock.com',
+ 'kinkyemail.com',
+ 'kool-things.com',
+ 'krovatka.net',
+ 'kuwaiti.tv',
+ 'kyrgyzstan.cc',
+ 'land.ru',
+ 'latakia.cc',
+ 'latchess.com',
+ 'latinabarbie.com',
+ 'latinogreeks.com',
+ 'lawyer.com',
+ 'lebanese.cc',
+ 'leesville.com',
+ 'legislator.com',
+ 'list.ru',
+ 'live.com',
+ 'lobbyist.com',
+ 'london.com',
+ 'loveable.com',
+ 'loveemail.com',
+ 'loveis.lv',
+ 'lovers-mail.com',
+ 'lowrider.com',
+ 'lubnan.cc',
+ 'lubnan.ws',
+ 'lucky7lotto.net',
+ 'lv-inter.net',
+ 'mad.scientist.com',
+ 'madeniggaz.net',
+ 'madinah.cc',
+ 'madrid.com',
+ 'maghreb.cc',
+ 'mail.com',
+ 'mail.ru',
+ 'mail15.com',
+ 'mail333.com',
+ 'mailbomb.com',
+ 'manama.cc',
+ 'mansoura.tv',
+ 'marillion.net',
+ 'marrakesh.cc',
+ 'mascara.ws',
+ 'megarave.com',
+ 'meknes.cc',
+ 'mesra.net',
+ 'mindless.com',
+ 'minister.com',
+ 'mofa.com',
+ 'moscowmail.com',
+ 'motley.com',
+ 'munich.com',
+ 'muscat.tv',
+ 'muscat.ws',
+ 'music.com',
+ 'musician.net',
+ 'musician.org',
+ 'musicsites.com',
+ 'myself.com',
+ 'nabeul.cc',
+ 'nabeul.info',
+ 'nablus.cc',
+ 'nador.cc',
+ 'najaf.cc',
+ 'narod.ru',
+ 'netbroadcaster.com',
+ 'netfingers.com',
+ 'net-surf.com',
+ 'nettaxi.com',
+ 'newmail.ru',
+ 'ni cedriveway.com',
+ 'nightmail.ru',
+ 'nm.ru',
+ 'nocharge.com',
+ 'nycmail.com',
+ 'omani.ws',
+ 'omdurman.cc',
+ 'operationivy.com',
+ 'optician.com',
+ 'oran.cc',
+ 'oued.info',
+ 'oued.org',
+ 'oujda.biz',
+ 'oujda.cc',
+ 'paidoffers.net',
+ 'pakistani.ws',
+ 'palmyra.cc',
+ 'palmyra.ws',
+ 'pcbee.com',
+ 'pediatrician.com',
+ 'persian.com',
+ 'petrofind.com',
+ 'phunkybitches.com',
+ 'pikaguam.com',
+ 'pinkcity.net',
+ 'pisem.net',
+ 'pitbullmail.com',
+ 'planetsmeg.com',
+ 'playful.com',
+ 'pochta.ru',
+ 'pochtamt.ru',
+ 'poetic.com',
+ 'pookmail.com',
+ 'poop.com',
+ 'poormail.com',
+ 'pop3.ru',
+ 'popstar.com',
+ 'portsaid.cc',
+ 'post.com',
+ 'potsmokersnet.com',
+ 'presidency.com',
+ 'priest.com',
+ 'primetap.com',
+ 'programmer.net',
+ 'project420.com',
+ 'prolife.net',
+ 'publicist.com',
+ 'puertoricowow.com',
+ 'puppetweb.com',
+ 'qassem.cc',
+ 'quds.cc',
+ 'rabat.cc',
+ 'rafah.cc',
+ 'ramallah.cc',
+ 'rambler.ru',
+ 'rapstar.com',
+ 'rapworld.com',
+ 'rastamall.com',
+ 'ratedx.net',
+ 'ravermail.com',
+ 'rbcmail.ru',
+ 'realtyagent.com',
+ 'rediffmail.com',
+ 'registerednurses.com',
+ 'relapsecult.com',
+ 'remixer.com',
+ 'repairman.com',
+ 'representative.com',
+ 'rescueteam.com',
+ 'rockeros.com',
+ 'romance106fm.com',
+ 'rome.com',
+ 'sa veourplanet.org',
+ 'safat.biz',
+ 'safat.info',
+ 'safat.us',
+ 'safat.ws',
+ 'saintly.com',
+ 'salalah.cc',
+ 'salmiya.biz',
+ 'samerica.com',
+ 'sanaa.cc',
+ 'sanfranmail.com',
+ 'scientist.com',
+ 'seductive.com',
+ 'seeb.cc',
+ 'sexriga.lv',
+ 'sfax.ws',
+ 'sharm.cc',
+ 'sinai.cc',
+ 'singalongcenter.com',
+ 'singapore.com',
+ 'siria.cc',
+ 'sketchyfriends.com',
+ 'slayerized.com',
+ 'smartstocks.com',
+ 'smtp.ru',
+ 'sociologist.com',
+ 'sok.lv',
+ 'soon.com',
+ 'soulja-beatz.org',
+ 'sousse.cc',
+ 'spam.lv',
+ 'specialoperations.com',
+ 'speedymail.net',
+ 'spells.com',
+ 'streetracing.com',
+ 'subspacemail.com',
+ 'sudanese.cc',
+ 'suez.cc',
+ 'sugarray.com',
+ 'superbikeclub.com',
+ 'superintendents.net',
+ 'supermail.ru',
+ 'surfguiden.com',
+ 'sweetwishes.com',
+ 'tabouk.cc',
+ 'tajikistan.cc',
+ 'tangiers.cc',
+ 'tanta.cc',
+ 'tattoodesign.com',
+ 'tayef.cc',
+ 'teamster.net',
+ 'techie.com',
+ 'technologist.com',
+ 'teenchatnow.com',
+ 'tetouan.cc',
+ 'the5thquarter.com',
+ 'theblackmarket.com',
+ 'timor.cc',
+ 'tokyo.com',
+ 'tombstone.ws',
+ 'troamail.org',
+ 'tunisian.cc',
+ 'tunisian.cc',
+ 'tut.by',
+ 'tx.am',
+ 'u2tours.com',
+ 'ua.fm',
+ 'uaix.info',
+ 'umpire.com',
+ 'urdun.cc',
+ 'usa.com',
+ 'vipmail.ru',
+ 'vitalogy.org',
+ 'whatisthis.com',
+ 'whoever.com',
+ 'winning.com',
+ 'witty.com',
+ 'wrestlezone.com',
+ 'writeme.com',
+ 'yahoo.ca',
+ 'yahoo.com',
+ 'yanbo.cc',
+ 'yandex.ru',
+ 'yepmail.com',
+ 'yemeni.cc',
+ 'yogaelements.com',
+ 'yours.com',
+ 'yunus.cc',
+ 'zabor.lv',
+ 'zagazig.cc',
+ 'zambia.cc',
+ 'zarqa.cc',
+ 'zerogravityclub.com');
+
+ static function isFree($domain) {
+ return in_array($domain, self::$domains);
+ }
+}
\ No newline at end of file
-#!/usr/bin/env php
- <?php
- /*
- * StatusNet - a distributed open-source microblogging tool
- * Copyright (C) 2010, 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/>.
- */
+<?php
+/*
+ * StatusNet - a distributed open-source microblogging tool
+ * Copyright (C) 2010, 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/>.
+ */
define('INSTALLDIR', realpath(dirname(__FILE__) . '/../..'));
StatusNet::init($server);
// Different queue manager, maybe!
$qm = QueueManager::get();
- $qm->enqueue(null, 'sitesum');
+ $qm->enqueue(1, 'sitesum');
}
}
} else {
$user = getUser();
$qm->enqueue($user->id, 'usersum');
} catch (NoUserArgumentException $nuae) {
- $qm->enqueue(null, 'sitesum');
+ $qm->enqueue(1, 'sitesum');
}
}
*/
function transport()
{
- return 'sitesum';
+ return 'usersum';
}
/**
$new_top = $notice->_items[0]->id;
}
- $out = new XMLStringer();
+ $out = new XMLStringer(true);
$out->elementStart('div', array('width' => '100%',
'style' => 'background-color: #ffffff; border: 4px solid #4c609a; padding: 10px;'));
// FIXME: do something for people who don't like HTML email
+ $subject = sprintf(_m('Your latest updates from %s'), common_config('site', 'name'));
+
// TRANS: Subject for e-mail.
- mail_to_user($user, _m('Updates from your network'), $body,
+
+ mail_to_user($user,
+ $subject,
+ $body,
array('Content-Type' => 'text/html; charset=UTF-8'));
if (empty($ess)) {
*/
class GoogleAnalyticsPlugin extends Plugin
{
- var $code = null;
+ var $code;
+ var $domain;
+
+ const VERSION = '0.2';
function __construct($code=null)
{
- $this->code = $code;
+ if (!empty($code)) {
+ global $config;
+ $config['googleanalytics']['code'] = $code;
+ }
+
parent::__construct();
}
function onEndShowScripts($action)
{
- $js1 = 'var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");'.
- 'document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));';
- $js2 = sprintf('try{'.
- 'var pageTracker = _gat._getTracker("%s");'.
- 'pageTracker._trackPageview();'.
- '} catch(err) {}',
- $this->code);
- $action->inlineScript($js1);
- $action->inlineScript($js2);
+ $code = common_config('googleanalytics', 'code');
+ if (empty($code)) {
+ $code = $this->code;
+ }
+ $domain = common_config('googleanalytics', 'domain');
+ if (empty($domain)) {
+ $domain = $this->domain;
+ }
+
+ $js = <<<ENDOFSCRIPT0
+
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', '{$code}']);
+_gaq.push(['_trackPageview']);
+
+ENDOFSCRIPT0;
+
+if (!empty($domain)) {
+ $js .= <<<ENDOFSCRIPT1
+
+_gaq.push(['_setDomainName', '{$domain}']);
+_gaq.push(['_setAllowHash', false]);
+
+ENDOFSCRIPT1;
+}
+
+ $js .= <<<ENDOFSCRIPT2
+
+(function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+
+ENDOFSCRIPT2;
+
+ $action->inlineScript($js);
}
function onPluginVersion(&$versions)
{
$versions[] = array('name' => 'GoogleAnalytics',
- 'version' => STATUSNET_VERSION,
+ 'version' => self::VERSION,
'author' => 'Evan Prodromou',
'homepage' => 'http://status.net/wiki/Plugin:GoogleAnalytics',
'rawdescription' =>