projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve skin.
[platal.git]
/
include
/
xnet
/
session.inc.php
diff --git
a/include/xnet/session.inc.php
b/include/xnet/session.inc.php
index
d798261
..
92c189a
100644
(file)
--- a/
include/xnet/session.inc.php
+++ b/
include/xnet/session.inc.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-200
7
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 *
@@
-23,7
+23,8
@@
class XnetSession
{
// {{{ function init
{
// {{{ function init
- public static function init() {
+ public static function init()
+ {
global $globals;
S::init();
global $globals;
S::init();
@@
-34,7
+35,7
@@
class XnetSession
$returl = "http://{$_SERVER['SERVER_NAME']}".substr($_SERVER['REQUEST_URI'], 0, $i);
else
$returl = "http://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}";
$returl = "http://{$_SERVER['SERVER_NAME']}".substr($_SERVER['REQUEST_URI'], 0, $i);
else
$returl = "http://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}";
- $url = "https://www.polytechnique.org/auth-groupex
.php
";
+ $url = "https://www.polytechnique.org/auth-groupex";
$url .= "?session=" . session_id();
$url .= "&challenge=" . S::v('challenge');
$url .= "&pass=" . md5(S::v('challenge') . $globals->xnet->secret);
$url .= "?session=" . session_id();
$url .= "&challenge=" . S::v('challenge');
$url .= "&pass=" . md5(S::v('challenge') . $globals->xnet->secret);
@@
-46,12
+47,20
@@
class XnetSession
$perms = S::v('perms');
$perms->rmFlag('groupadmin');
$perms->rmFlag('groupmember');
$perms = S::v('perms');
$perms->rmFlag('groupadmin');
$perms->rmFlag('groupmember');
+ $perms->rmFlag('groupannu');
if (may_update()) {
$perms->addFlag('groupadmin');
$perms->addFlag('groupmember');
if (may_update()) {
$perms->addFlag('groupadmin');
$perms->addFlag('groupmember');
+ $perms->addFlag('groupannu');
}
if (is_member()) {
$perms->addFlag('groupmember');
}
if (is_member()) {
$perms->addFlag('groupmember');
+ if ($globals->asso('pub') != 'private') {
+ $perms->addFlag('groupannu');
+ }
+ }
+ if ($globals->asso('cat') == 'Promotions') {
+ $perms->addFlag('groupannu');
}
$_SESSION['perms'] = $perms;
}
}
$_SESSION['perms'] = $perms;
}
@@
-95,11
+104,16
@@
class XnetSession
// }}}
// {{{ doAuthX
// }}}
// {{{ doAuthX
- public static function doAuthX()
+ public static function doAuthX()
{
global $globals, $page;
if (md5('1'.S::v('challenge').$globals->xnet->secret.Get::i('uid').'1') != Get::v('auth')) {
{
global $globals, $page;
if (md5('1'.S::v('challenge').$globals->xnet->secret.Get::i('uid').'1') != Get::v('auth')) {
+ Get::kill('auth');
+ if (!$page) {
+ require_once 'xnet.inc.php';
+ new_skinned_page('platal/index.tpl');
+ }
$page->kill("Erreur d'authentification avec polytechnique.org !");
}
$page->kill("Erreur d'authentification avec polytechnique.org !");
}
@@
-150,7
+164,7
@@
class XnetSession
// {{{ killSuid
public static function killSuid()
// {{{ killSuid
public static function killSuid()
- {
+ {
if (!S::has('suid')) {
return;
}
if (!S::has('suid')) {
return;
}
@@
-202,7
+216,7
@@
function may_update($force = false, $lose = false)
/** Get membership informations for the current asso
* @param force Force membership to be read from database
* @param lose Force membership to be false
/** Get membership informations for the current asso
* @param force Force membership to be read from database
* @param lose Force membership to be false
- */
+ */
function is_member($force = false, $lose = false)
{
if (!isset($_SESSION['is_member'])) {
function is_member($force = false, $lose = false)
{
if (!isset($_SESSION['is_member'])) {