Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
831 florian 1
<?php
2
 
3
////////////////////////////////////////////////////////////////////////////////
4
//                                                                            //
5
//   Copyright (C) 2006  Phorum Development Team                              //
6
//   http://www.phorum.org                                                    //
7
//                                                                            //
8
//   This program is free software. You can redistribute it and/or modify     //
9
//   it under the terms of either the current Phorum License (viewable at     //
10
//   phorum.org) or the Phorum License that was distributed with this file    //
11
//                                                                            //
12
//   This program is distributed in the hope that it will be useful,          //
13
//   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
14
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
15
//                                                                            //
16
//   You should have received a copy of the Phorum License                    //
17
//   along with this program.                                                 //
18
////////////////////////////////////////////////////////////////////////////////
19
 
20
if(!defined("PHORUM_CONTROL_CENTER")) return;
21
 
22
$template = "cc_start";
23
$PHORUM['DATA']['UserPerms'] = phorum_readable_permissions();
24
$PHORUM['DATA']['PROFILE']['date_added'] = phorum_date( $PHORUM['short_date'], $PHORUM['DATA']['PROFILE']['date_added']);
25
if( $PHORUM["track_user_activity"] &&
26
    (!empty($PHORUM["user"]["admin"]) ||
27
     (phorum_user_access_allowed(PHORUM_USER_ALLOW_MODERATE_MESSAGES)) ||
28
     (phorum_user_access_allowed(PHORUM_USER_ALLOW_MODERATE_USERS)) ||
29
     !$user["hide_activity"])){
30
 
31
    $PHORUM["DATA"]["PROFILE"]["date_last_active"]=phorum_date( $PHORUM['short_date'], $PHORUM["DATA"]["PROFILE"]["date_last_active"]);
32
} else {
33
    unset($PHORUM["DATA"]["PROFILE"]["date_last_active"]);
34
}
35
 
36
$PHORUM["DATA"]["PROFILE"]["username"] = htmlspecialchars($PHORUM["DATA"]["PROFILE"]["username"]);
37
 
38
$PHORUM["DATA"]["PROFILE"] = phorum_hook("profile", $PHORUM["DATA"]["PROFILE"]);
39
/* --------------------------------------------------------------- */
40
 
41
function phorum_readable_permissions()
42
{
43
    $PHORUM = $GLOBALS['PHORUM'];
44
    $newperms = array();
45
 
46
    if (isset($PHORUM["user"]["permissions"])) {
47
        $forums = phorum_db_get_forums(array_keys($PHORUM["user"]["permissions"]));
48
 
49
        foreach($PHORUM["user"]["permissions"] as $forum => $perms) {
50
            if(isset($forums[$forum])) {
51
                if($perms & PHORUM_USER_ALLOW_MODERATE_MESSAGES){
52
                    $newperms[] = array('forum' => $forums[$forum]["name"], 'perm' => $PHORUM['DATA']['LANG']['PermModerator']);
53
                }
54
 
55
                if($perms & PHORUM_USER_ALLOW_READ){
56
                    $newperms[] = array('forum' => $forums[$forum]["name"], 'perm' => $PHORUM['DATA']['LANG']['PermAllowRead']);
57
                }
58
 
59
                if($perms & PHORUM_USER_ALLOW_REPLY){
60
                    $newperms[] = array('forum' => $forums[$forum]["name"], 'perm' => $PHORUM['DATA']['LANG']['PermAllowReply']);
61
                }
62
 
63
                if($perms & PHORUM_USER_ALLOW_NEW_TOPIC){
64
                    $newperms[] = array('forum' => $forums[$forum]["name"], 'perm' => $PHORUM['DATA']['LANG']['PermAllowPost']);
65
                }
66
            }
67
        }
68
    }
69
 
70
    return $newperms;
71
}
72
?>