'nom' => null,
'grpauth' => null,
'perms' => null);
- static public function behavior_coreBlogConstruct(&$blog) {
+ static public function behavior_coreBlogConstruct($blog) {
global $core;
$core->auth->sudo(array($core->auth, 'updateUserPerms'), $blog);
}
- public function __construct(&$core) {
+ public function __construct($core) {
parent::__construct($core);
$core->addBehavior('coreBlogConstruct', array('xorgAuth', 'behavior_coreBlogConstruct'));
}
}
}
- public function updateUserPerms(&$blog) {
+ public function updateUserPerms($blog) {
global $core;
$this->buildFromSession();
if (!isset($_SESSION['auth-xorg'])) {
$this->killSession();
return;
}
- if (($type == 'group-admin' || $type == 'group-member') && $level == 'admin') {
+ if (($type == 'group-admin' || $type == 'group-member' || $type == 'connected') && $level == 'admin') {
$perms = array('usage' => true,
'contentadmin' => true,
'admin' => true);
} else if ($type == 'group-member' && $level == 'membre') {
$perms = array('usage' => true);
+ } else if ($type == 'connected' && $this->xorg_infos['forlife'] != '') {
+ $perms = array('usage' => true);
} else if ($type == 'user' && $owner == $this->xorg_infos['forlife']) {
$perms = array('usage' => true,
'contentadmin' => true,
$url .= "&challenge=" . $_SESSION["auth-x-challenge"];
$url .= "&pass=" . md5($_SESSION["auth-x-challenge"] . XORG_AUTH_KEY);
$type = $core->blog->settings->xorgauth->get('xorg_blog_type');
- if ($type == 'group-member' || $type == 'group-admin') {
+ if ($type == 'group-member' || $type == 'group-admin' || $type == 'connected') {
$url .= '&group=' . $core->blog->settings->xorgauth->get('xorg_blog_owner');
}
$url .= "&url=" . urlencode($core->blog->url . "auth/XorgReturn?path=" . $path);