function dispatch() { $session = \Sessionx::start(); requestURL('http://localhost:1560/disconnect/', 2, ['sid' => $session->sessionid]); Session::dispose(); $this->redirect('login'); }
function display() { $submit = $this->call('ajaxLogin', "MovimUtils.formToJson('login')"); $cd = new \Modl\ConfigDAO(); $config = $cd->get(); $this->view->assign('submit', $submit); $this->view->assign('info', $config->info); $this->view->assign('whitelist', $config->xmppwhitelist); if (isset($config->xmppdomain) && !empty($config->xmppdomain)) { $this->view->assign('domain', $config->xmppdomain); } else { $this->view->assign('domain', 'movim.eu'); } $pop = 0; foreach (scandir(USERS_PATH) as $f) { if (is_dir(USERS_PATH . '/' . $f)) { $pop++; } } $this->view->assign('pop', $pop - 2); $this->view->assign('connected', (int) requestURL('http://*****:*****@', $_SERVER['HTTP_EMAIL']); $this->view->assign('httpAuthHost', $host); $this->view->assign('httpAuthUser', $_SERVER['HTTP_EMAIL']); $this->view->assign('httpAuthPassword', $_SERVER['PHP_AUTH_PW']); } }
/** * @desc Load a bin picture from an URL */ public function fromURL($url) { $bin = requestURL($url, 10); if ($bin) { $this->_bin = $bin; } }
function display() { $json = requestURL(MOVIM_API . 'pods', 1); $json = json_decode($json); if (is_object($json) && $json->status == 200) { $this->view->assign('pods', $json); } }
function display() { $json = requestURL(MOVIM_API . 'servers', 3); $json = json_decode($json); $cd = new \Modl\ConfigDAO(); $this->view->assign('config', $cd->get()); if (is_object($json) && $json->status == 200) { $this->view->assign('servers', $json->servers); } }
function ajaxRegister() { $cd = new \Modl\ConfigDAO(); $config = $cd->get(); $json = requestURL(MOVIM_API . 'register', 3, array('uri' => BASE_URI, 'rewrite' => false)); $json = json_decode($json); if (isset($json) && $json->status == 200) { RPC::call('MovimUtils.reloadThis'); Notification::append(null, $this->__('api.conf_updated')); } }
function ajaxRegister() { $rewrite = false; if (isset($_SERVER['HTTP_MOD_REWRITE']) && $_SERVER['HTTP_MOD_REWRITE']) { $rewrite = true; } $json = requestURL(MOVIM_API . 'register', 1, array('uri' => BASE_URI, 'rewrite' => $rewrite)); $json = json_decode($json); if (isset($json) && $json->status == 200) { RPC::call('movim_reload_this'); Notification::append(null, $this->__('api.conf_updated')); } }
function display() { $cd = new \Modl\ConfigDAO(); $config = $cd->get(); $l = Movim\i18n\Locale::start(); $this->view->assign('conf', $cd->get()); $this->view->assign('logs', array(0 => $this->__('log.empty'), 1 => $this->__('log.syslog'), 2 => $this->__('log.syslog_files'))); $this->view->assign('bosh_info4', $this->__('bosh.info4', '<a href="http://wiki.movim.eu/en:install">', '</a>')); $json = requestURL(MOVIM_API . 'websockets', 1); $json = json_decode($json); if (isset($json) && $json->status != 404) { $this->view->assign('websockets', $json); } $this->view->assign('timezones', getTimezoneList()); $this->view->assign('langs', $l->getList()); }
function display() { // We get the informations $pop = 0; foreach (scandir(USERS_PATH) as $f) { if (is_dir(USERS_PATH . '/' . $f)) { $pop++; } } $pop = $pop - 2; // We get the global configuration $cd = new \Modl\ConfigDAO(); $config = $cd->get(); $connected = (int) requestURL('http://localhost:1560/started/', 2); $infos = array('url' => BASE_URI, 'language' => $config->locale, 'whitelist' => $config->xmppwhitelist, 'timezone' => $config->timezone, 'description' => $config->description, 'unregister' => $config->unregister, 'php_version' => phpversion(), 'version' => APP_VERSION, 'population' => $pop, 'linked' => (int) requestURL('http://localhost:1560/linked/', 2), 'started' => $connected, 'connected' => $connected); $this->view->assign('json', json_encode($infos)); }
function prepareForm($me) { $avatarform = $this->tpl(); $p = new Picture(); $p->get($this->user->getLogin()); $avatarform->assign('photobin', $p->toBase()); $avatarform->assign('me', $me); if (isset($me->email)) { $result = requestURL(Gravatar::profile($me->email, 'json'), 3); $obj = json_decode($result); if ($obj != 'User not found') { $avatarform->assign('gravatar_bin', base64_encode(requestURL('http://www.gravatar.com/avatar/' . $obj->entry[0]->hash . '?s=250'))); $avatarform->assign('gravatar', $obj); } } $avatarform->assign('submit', $this->call('ajaxSubmit', "movim_form_to_json('avatarform')")); return $avatarform->draw('_avatar_form', true); }
function display() { $cd = new \Modl\ConfigDAO(); $config = $cd->get(); $this->view->assign('conf', $cd->get()); $this->view->assign('logs', array(0 => $this->__('log.empty'), 1 => $this->__('log.syslog'), 2 => $this->__('log.syslog_files'))); $this->view->assign('bosh_info4', $this->__('bosh.info4', '<a href="http://wiki.movim.eu/en:install">', '</a>')); $json = requestURL(MOVIM_API . 'websockets', 1); $json = json_decode($json); if (isset($json) && $json->status != 404) { $this->view->assign('websockets', $json); } $this->view->assign('server_rewrite', false); if (isset($_SERVER['HTTP_MOD_REWRITE']) && $_SERVER['HTTP_MOD_REWRITE']) { $this->view->assign('server_rewrite', true); } $this->view->assign('timezones', getTimezoneList()); $this->view->assign('langs', loadLangArray()); }
/** * Purify a string * @param string * @return string */ function purifyHTML($string) { return (string) requestURL('http://localhost:1560/purify/', 2, ['html' => urlencode($string)]); }
function getLastFM($contact) { $uri = str_replace(' ', '%20', 'http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=80c1aa3abfa9e3d06f404a2e781e38f9&artist=' . $contact->tuneartist . '&album=' . $contact->tunesource . '&format=json'); $json = json_decode(requestURL($uri, 2)); $img = $json->album->image[2]->{'#text'}; $url = $json->album->url; return array($img, $url); }
function onServiceUnavailable() { Notification::append(null, $this->__('error.service_unavailable')); $session = \Sessionx::start(); requestURL('http://localhost:1560/disconnect/', 2, ['sid' => $session->sessionid]); RPC::call('MovimUtils.redirect', $this->route('account')); }
/** * Checks if the user has an open session. */ function isLogged() { // We check if the session exists in the daemon $session = \Sessionx::start(); return (bool) requestURL('http://localhost:1560/exists/', 2, ['sid' => $session->sessionid]); }
function getAlbum() { $uri = str_replace(' ', '%20', 'http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=80c1aa3abfa9e3d06f404a2e781e38f9&artist=' . $this->tuneartist . '&album=' . $this->tunesource . '&format=json'); $json = json_decode(requestURL($uri, 2)); if ($json->album) { $json->album->url = $json->album->image[2]->{'#text'}; return $json->album; } }
function dispatch() { $session = \Sessionx::start(); requestURL('http://localhost:1560/disconnect/', 2, ['sid' => $session->sessionid]); $this->page->setTitle(__('page.account_creation')); }
function display() { //if(isset($_GET['f'])) { // list($jid, $resource) = explode('/', htmlentities($_GET['f'])); $json = requestURL('https://computeengineondemand.appspot.com/turn?username=93773443&key=4080218913', 1); $this->view->assign('turn_list', $json); /* $cd = new \Modl\ContactDAO(); $contact = $cd->get($jid); if(!$contact) $contact = new modl\Contact(); $this->view->assign('avatar',$contact->getPhoto('l')); $this->view->assign('name' ,$contact->getTrueName()); $this->view->assign('jid' ,$jid); $this->view->assign('resource' ,$resource); }*/ }