示例#1
0
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/common.php';
dgr_require('/includes/user.php');
dgr_startup();
try {
    $user = new DGradeUser();
    $style = dgr_get_style('.', $user->get_styleid());
} catch (Exception $e) {
    /* user not logged in */
    dgr_redirect('index.php');
}
if ($user->get_level() != 0) {
    die;
}
$users = dgr_get_users();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
示例#2
0
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/common.php';
dgr_require('/includes/user.php');
dgr_startup();
try {
    $user = new DGradeUser();
    $style = dgr_get_style('.', $user->get_styleid());
} catch (Exception $e) {
    /* user not logged in */
    dgr_redirect('index.php');
}
$changeok = true;
if (isset($_POST['change_settings'])) {
    switch ($_POST['change_settings']) {
        case 1:
            $user->set_name($_POST['name']);
            $user->set_surname($_POST['surname']);
            $user->set_email($_POST['email']);
            $user->set_styleid($_POST['style']);
            $user->save();
            break;
        case 2: