private $_tpl;
private $_errors;
private $_failure;
+ private $_jsonVars;
// {{{ function PlatalPage()
$this->_page_type = $type;
$this->_tpl = $tpl;
$this->_errors = array();
+ $this->_jsonVars = array();
$this->_failure = false;
$this->register_prefilter('at_to_globals');
$this->assign('xorg_failure', $this->_failure);
$this->assign('globals', $globals);
+ if (Env::has('json') && count($this->_jsonVars)) {
+ return $this->jsonDisplay();
+ }
+
if (Env::v('display') == 'light') {
$this->_page_type = SIMPLE;
} elseif (Env::v('display') == 'raw') {
$this->register_outputfilter('hide_emails');
$this->addJsLink('wiki.js');
header("Accept-Charset: utf-8");
+ if (Env::v('forceXml')) {
+ header("Content-Type: text/xml; charset=utf-8");
+ }
if (!$globals->debug) {
error_reporting(0);
}
// }}}
+ // {{{ function jsonDisplay
+ protected function jsonDisplay()
+ {
+ header("Content-type: text/javascript; charset=utf-8");
+ array_walk_recursive($this->_jsonVars, "escape_xorgDB");
+ $jsonbegin = Env::v('jsonBegin');
+ $jsonend = Env::v('jsonEnd');
+ if (Env::has('jsonVar')) {
+ $jsonbegin = Env::v('jsonVar').' = ';
+ $jsonend = ';';
+ } elseif (Env::has('jsonFunc')) {
+ $jsonbegin = Env::v('jsonFunc').'(';
+ $jsonend = ');';
+ }
+ echo $jsonbegin, json_encode($this->_jsonVars), $jsonend;
+ exit;
+ }
+ // }}}
+ // {{{ function jsonAssign
+ public function jsonAssign($var, $value)
+ {
+ $this->_jsonVars[$var] = $value;
+ }
+}
+
+function escape_xorgDB(&$item, $key)
+{
+ if (is_a($item, 'XOrgDBIterator')) {
+ $expanded = array();
+ while ($a = $item->next()) {
+ $expanded[] = $a;
+ }
+ $item = $expanded;
+ }
}
// {{{ function escape_html ()
'groupes.php' => $this->make_hook('groups2', AUTH_PUBLIC),
'plan' => $this->make_hook('plan', AUTH_PUBLIC),
'photo' => $this->make_hook('photo', AUTH_MDP),
+ 'autologin' => $this->make_hook('autologin', AUTH_MDP),
);
}
$page->setType($cat);
}
+
+ function handler_autologin(&$page)
+ {
+ header("Content-type: text/javascript; charset=utf-8");
+ echo '$.ajax({ url: "index?forceXml=1", dataType: "xml", success: function(xml) { $("body").empty(); $("body",xml).prependTo("body"); }});';
+ exit;
+ }
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
m.perms='admin' AS admin,
m.origine='X' AS x,
u.perms!='pending' AS inscrit,
- m.uid, e.email AS actif
+ m.uid, IF(e.email IS NULL,NULL,1) AS actif
FROM groupex.membres AS m
LEFT JOIN auth_user_md5 AS u ON ( u.user_id = m.uid )
LEFT JOIN aliases AS a ON ( a.id = m.uid AND a.type='a_vie' )
ORDER BY $tri
LIMIT {?},{?}", $globals->asso('id'), $ofs*NB_PER_PAGE, NB_PER_PAGE);
$page->assign('ann', $ann);
+ $page->jsonAssign('ann', $ann);
}
function handler_trombi(&$page, $num = 1)