projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
require_once unused, class autoloaded
[platal.git]
/
modules
/
auth.php
diff --git
a/modules/auth.php
b/modules/auth.php
index
15b0fbe
..
70c7e00
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
7
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 *
@@
-24,7
+24,7
@@
class AuthModule extends PLModule
function handlers()
{
return array(
function handlers()
{
return array(
- 'groupex/done-chall.php'
+ 'groupex/don
n
e-chall.php'
=> $this->make_hook('chall', AUTH_PUBLIC),
'groupex/export-econfiance.php'
=> $this->make_hook('econf', AUTH_PUBLIC),
=> $this->make_hook('chall', AUTH_PUBLIC),
'groupex/export-econfiance.php'
=> $this->make_hook('econf', AUTH_PUBLIC),
@@
-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'),
);
}
@@
-49,8
+50,6
@@
class AuthModule extends PLModule
{
global $globals;
{
global $globals;
- require_once 'lists.inc.php';
-
$cle = $globals->core->econfiance;
if (S::v('chall') && $_GET['PASS'] == md5(S::v('chall').$cle)) {
$cle = $globals->core->econfiance;
if (S::v('chall') && $_GET['PASS'] == md5(S::v('chall').$cle)) {
@@
-58,8
+57,8
@@
class AuthModule extends PLModule
$res = XDB::query("SELECT password FROM auth_user_md5 WHERE user_id=10154");
$pass = $res->fetchOneCell();
$res = XDB::query("SELECT password FROM auth_user_md5 WHERE user_id=10154");
$pass = $res->fetchOneCell();
- $
client =& lists_xmlrpc
(10154, $pass, "x-econfiance.polytechnique.org");
- $members = $
clien
t->get_members('membres');
+ $
list = new MMList
(10154, $pass, "x-econfiance.polytechnique.org");
+ $members = $
lis
t->get_members('membres');
if (is_array($members)) {
$membres = Array();
foreach($members[1] as $member) {
if (is_array($members)) {
$membres = Array();
foreach($members[1] as $member) {
@@
-80,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";
@@
-92,6
+91,7
@@
class AuthModule extends PLModule
$res .= "</membres>\n\n";
$res .= "</membres>\n\n";
+ header('Content-Type: text/xml; charset="UTF-8"');
echo $res;
}
exit;
echo $res;
}
exit;
@@
-125,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"]);
@@
-138,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);
@@
-151,28
+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) {
- require_once('../classes/PLTableEditor.php');
+
+ 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:
?>
?>