projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'platal-0.9.17'
[platal.git]
/
modules
/
auth.php
diff --git
a/modules/auth.php
b/modules/auth.php
index
ea7e267
..
1459721
100644
(file)
--- a/
modules/auth.php
+++ b/
modules/auth.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-200
6
Polytechnique.org *
+ * Copyright (C) 2003-200
8
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-27,13
+27,14
@@
class AuthModule extends PLModule
'groupex/donne-chall.php'
=> $this->make_hook('chall', AUTH_PUBLIC),
'groupex/export-econfiance.php'
'groupex/donne-chall.php'
=> $this->make_hook('chall', AUTH_PUBLIC),
'groupex/export-econfiance.php'
- => $this->make_hook('econf', AUTH_PUBLIC),
+ => $this->make_hook('econf', AUTH_PUBLIC
, 'user', NO_HTTPS
),
'webservices/manageurs.php'
'webservices/manageurs.php'
- => $this->make_hook('manageurs', AUTH_PUBLIC),
+ => $this->make_hook('manageurs', AUTH_PUBLIC
, 'user', NO_HTTPS
),
'auth-redirect.php' => $this->make_hook('redirect', AUTH_COOKIE),
'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;
@@
-109,7
+110,7
@@
class AuthModule extends PLModule
xmlrpc_server_register_method($server, 'get_annuaire_infos', 'get_annuaire_infos');
xmlrpc_server_register_method($server, 'get_nouveau_infos', 'get_nouveau_infos');
xmlrpc_server_register_method($server, 'get_annuaire_infos', 'get_annuaire_infos');
xmlrpc_server_register_method($server, 'get_nouveau_infos', 'get_nouveau_infos');
- $request = $GLOBALS['HTTP_RAW_POST_DATA'];
+ $request =
@
$GLOBALS['HTTP_RAW_POST_DATA'];
$response = xmlrpc_server_call_method($server, $request, null);
header('Content-Type: text/xml');
print $response;
$response = xmlrpc_server_call_method($server, $request, null);
header('Content-Type: text/xml');
print $response;
@@
-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)
{
{
- require_once dirname(__FILE__).'/auth/auth.inc.php';
+ return $this->handler_groupex($page, 'iso-8859-1');
+ }
+
+ function handler_groupex(&$page, $charset = 'utf8')
+ {
+ $this->load('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,40
+144,45
@@
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
+ $uid = S::i('uid');
if (!isset($_SESSION['suid'])) {
$logger = (isset($_SESSION['log']) && $_SESSION['log']->uid == $uid)
if (!isset($_SESSION['suid'])) {
$logger = (isset($_SESSION['log']) && $_SESSION['log']->uid == $uid)
- ? $_SESSION['log'] : new
Core
Logger($uid);
+ ? $_SESSION['log'] : new
Pl
Logger($uid);
global $platal;
global $platal;
-
$logger
->log('connexion_auth_ext', $platal->path);
+
S::logger()
->log('connexion_auth_ext', $platal->path);
}
/* 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) {
- $page->assign('xorg_title','Polytechnique.org - Administration - Auth groupes X');
- $page->assign('title', 'Gestion de l\'authentification centralisée');
+
+ function handler_admin_authgroupesx(&$page, $action = 'list', $id = null)
+ {
+ $page->setTitle('Administration - Auth groupes X');
+ $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:
?>
?>