Subversion Repositories Applications.papyrus

Rev

Rev 1372 | Details | Compare with Previous | 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
if (!$PHORUM["DATA"]["USER_MODERATOR"]) {
23
    phorum_redirect_by_url(phorum_get_url(PHORUM_CONTROLCENTER_URL));
24
    exit();
25
}
26
 
27
$users=phorum_db_user_get_unapproved();
28
 
29
if(!empty($_POST["user_ids"])){
30
 
31
    foreach($_POST["user_ids"] as $user_id){
32
 
33
        if(!isset($_POST["approve"])){
34
            $userdata["active"]=PHORUM_USER_INACTIVE;
35
        } else {
36
            $user=phorum_user_get($user_id);
37
            if($user["active"]==PHORUM_USER_PENDING_BOTH){
38
                $userdata["active"]=PHORUM_USER_PENDING_EMAIL;
39
            } else {
40
                $userdata["active"]=PHORUM_USER_ACTIVE;
41
                // send reg approved message
42
                $maildata["mailsubject"]=$PHORUM["DATA"]["LANG"]["RegApprovedSubject"];
43
                $maildata["mailmessage"]=wordwrap($PHORUM["DATA"]["LANG"]["RegApprovedEmailBody"], 72);
44
                phorum_email_user(array($user["email"]), $maildata);
45
            }
46
        }
47
 
48
        $userdata["user_id"]=$user_id;
49
 
50
        phorum_db_user_save($userdata);
51
    }
52
}
53
 
54
if(empty($users)){
55
    $PHORUM["DATA"]["MESSAGE"] = $PHORUM["DATA"]["LANG"]["NoUnapprovedUsers"];
56
} else {
57
 
58
    // get a fresh list to update any changes
59
    $users=phorum_db_user_get_unapproved();
60
 
61
    $PHORUM["DATA"]["USERS"]=$users;
62
 
63
    $PHORUM["DATA"]["ACTION"]=phorum_get_url( PHORUM_CONTROLCENTER_ACTION_URL );
64
    $PHORUM["DATA"]["FORUM_ID"]=$PHORUM["forum_id"];
65
 
66
    $template = "cc_users";
67
}
68
 
69
?>