projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
page des perdus de vue
[platal.git]
/
modules
/
auth.php
diff --git
a/modules/auth.php
b/modules/auth.php
index
35618c1
..
70c7e00
100644
(file)
--- a/
modules/auth.php
+++ b/
modules/auth.php
@@
-33,7
+33,8
@@
class AuthModule extends PLModule
=> $this->make_hook('manageurs', AUTH_PUBLIC),
'auth-redirect.php' => $this->make_hook('redirect', AUTH_COOKIE),
=> $this->make_hook('manageurs', AUTH_PUBLIC),
'auth-redirect.php' => $this->make_hook('redirect', AUTH_COOKIE),
- 'auth-groupex.php' => $this->make_hook('groupex', AUTH_COOKIE),
+ 'auth-groupex.php' => $this->make_hook('groupex_old', AUTH_COOKIE),
+ 'auth-groupex' => $this->make_hook('groupex', AUTH_COOKIE),
'admin/auth-groupes-x' => $this->make_hook('admin_authgroupesx', AUTH_MDP, 'admin'),
);
}
'admin/auth-groupes-x' => $this->make_hook('admin_authgroupesx', AUTH_MDP, 'admin'),
);
}
@@
-78,7
+79,7
@@
class AuthModule extends PLModule
WHERE $where
ORDER BY nom");
WHERE $where
ORDER BY nom");
- $res = "<?xml version=\"1.0\" encoding=\"
ISO-8859-1
\"?>\n\n<membres>\n\n";
+ $res = "<?xml version=\"1.0\" encoding=\"
UTF-8
\"?>\n\n<membres>\n\n";
while (list ($prenom1,$nom1,$email1) = $all->next()) {
$res .= "<membre>\n";
while (list ($prenom1,$nom1,$email1) = $all->next()) {
$res .= "<membre>\n";
@@
-90,7
+91,7
@@
class AuthModule extends PLModule
$res .= "</membres>\n\n";
$res .= "</membres>\n\n";
- header('Content-Type: text/xml; charset="
ISO-8859-1
"');
+ header('Content-Type: text/xml; charset="
UTF-8
"');
echo $res;
}
exit;
echo $res;
}
exit;
@@
-124,9
+125,15
@@
class AuthModule extends PLModule
http_redirect(Env::v('dest', '/'));
}
http_redirect(Env::v('dest', '/'));
}
- function handler_groupex(&$page)
+ function handler_groupex_old(&$page)
+ {
+ return $this->handler_groupex($page, 'iso-8859-1');
+ }
+
+ function handler_groupex(&$page, $charset = 'utf8')
{
require_once dirname(__FILE__).'/auth/auth.inc.php';
{
require_once dirname(__FILE__).'/auth/auth.inc.php';
+ $page->assign('referer', true);
$gpex_pass = $_GET["pass"];
$gpex_url = urldecode($_GET["url"]);
$gpex_pass = $_GET["pass"];
$gpex_url = urldecode($_GET["url"]);
@@
-137,11
+144,12
@@
class AuthModule extends PLModule
}
/* a-t-on besoin d'ajouter le http:// ? */
}
/* a-t-on besoin d'ajouter le http:// ? */
- if (!preg_match("/^(http|https):\/\/.*/",$gpex_url))
+ if (!preg_match("/^(http|https):\/\/.*/",$gpex_url))
{
$gpex_url = "http://$gpex_url";
$gpex_url = "http://$gpex_url";
+ }
$gpex_challenge = $_GET["challenge"];
$gpex_challenge = $_GET["challenge"];
- // mise
à
jour de l'heure et de la machine de dernier login sauf quand on est en suid
+ // mise
à
jour de l'heure et de la machine de dernier login sauf quand on est en suid
if (!isset($_SESSION['suid'])) {
$logger = (isset($_SESSION['log']) && $_SESSION['log']->uid == $uid)
? $_SESSION['log'] : new CoreLogger($uid);
if (!isset($_SESSION['suid'])) {
$logger = (isset($_SESSION['log']) && $_SESSION['log']->uid == $uid)
? $_SESSION['log'] : new CoreLogger($uid);
@@
-150,27
+158,30
@@
class AuthModule extends PLModule
}
/* on parcourt les entrees de groupes_auth */
}
/* on parcourt les entrees de groupes_auth */
- $res = XDB::iterRow('
select privkey,name,datafields from
groupesx_auth');
+ $res = XDB::iterRow('
SELECT privkey, name, datafields FROM
groupesx_auth');
while (list($privkey,$name,$datafields) = $res->next()) {
if (md5($gpex_challenge.$privkey) == $gpex_pass) {
while (list($privkey,$name,$datafields) = $res->next()) {
if (md5($gpex_challenge.$privkey) == $gpex_pass) {
- $returl = $gpex_url
.gpex_make_params($gpex_challenge,$privkey,$datafields
);
+ $returl = $gpex_url
. gpex_make_params($gpex_challenge, $privkey, $datafields, $charset
);
http_redirect($returl);
}
}
http_redirect($returl);
}
}
- /* si on n'a pas trouv
é
, on renvoit sur x.org */
+ /* si on n'a pas trouv
é
, on renvoit sur x.org */
http_redirect('https://www.polytechnique.org/');
}
http_redirect('https://www.polytechnique.org/');
}
- function handler_admin_authgroupesx(&$page, $action = 'list', $id = null) {
+
+ function handler_admin_authgroupesx(&$page, $action = 'list', $id = null)
+ {
$page->assign('xorg_title','Polytechnique.org - Administration - Auth groupes X');
$page->assign('xorg_title','Polytechnique.org - Administration - Auth groupes X');
- $page->assign('title', 'Gestion de l\'authentification centralis
é
e');
+ $page->assign('title', 'Gestion de l\'authentification centralis
é
e');
$table_editor = new PLTableEditor('admin/auth-groupes-x','groupesx_auth','id');
$table_editor->describe('name','nom',true);
$table_editor = new PLTableEditor('admin/auth-groupes-x','groupesx_auth','id');
$table_editor->describe('name','nom',true);
- $table_editor->describe('privkey','cl
é privé
e',false);
- $table_editor->describe('datafields','champs renvoy
é
s',true);
+ $table_editor->describe('privkey','cl
é privé
e',false);
+ $table_editor->describe('datafields','champs renvoy
é
s',true);
$table_editor->apply($page, $action, $id);
}
}
$table_editor->apply($page, $action, $id);
}
}
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>
?>