\\\\_\ ·
· \\) \____) ·
· ·
· ·
· ·
· Qvitter 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 three of the License or (at ·
· your option) any later version. ·
· ·
· Qvitter is distributed in hope that it will be useful but WITHOUT ANY ·
· WARRANTY; without even the implied warranty of MERCHANTABILTY 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 Qvitter. If not, see . ·
· ·
· Contact h@nnesmannerhe.im if you have any questions. ·
· ·
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · */
class QvitterAction extends ApiAction
{
function isReadOnly($args)
{
return true;
}
protected function prepare(array $args=array())
{
parent::prepare($args);
$user = common_current_user();
return true;
}
protected function handle()
{
parent::handle();
$this->showQvitter();
}
function showQvitter()
{
$logged_in_user_nickname = '';
$logged_in_user_obj = false;
$logged_in_user = common_current_user();
if($logged_in_user) {
$logged_in_user_nickname = $logged_in_user->nickname;
$logged_in_user_obj = ApiAction::twitterUserArray($logged_in_user->getProfile());
}
$registrationsclosed = false;
if(common_config('site','closed') == 1 || common_config('site','inviteonly') == 1) {
$registrationsclosed = true;
}
$sitetitle = common_config('site','name');
$siterootdomain = common_config('site','server');
$qvitterpath = Plugin::staticPath('Qvitter', '');
$apiroot = common_path('api/', StatusNet::isHTTPS());
$instanceurl = common_path('', StatusNet::isHTTPS());
common_set_returnto(''); // forget this
// if this is a profile we add a link header for LRDD Discovery (see WebfingerPlugin.php)
if(substr_count($_SERVER['REQUEST_URI'], '/') == 1) {
$nickname = substr($_SERVER['REQUEST_URI'],1);
if(preg_match("/^[a-zA-Z0-9]+$/", $nickname) == 1) {
$acct = 'acct:'. $nickname .'@'. common_config('site', 'server');
$url = common_local_url('webfinger') . '?resource='.$acct;
foreach (array(Discovery::JRD_MIMETYPE, Discovery::XRD_MIMETYPE) as $type) {
header('Link: <'.$url.'>; rel="'. Discovery::LRDD_REL.'"; type="'.$type.'"');
}
}
}
?>