Verzeichnisstruktur phpBB-2.0.0


Veröffentlicht
03.04.2002

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

usercp_activate.php

Zuletzt modifiziert: 09.10.2024, 12:51 - Dateigröße: 4.00 KiB


001  <?php
002  /***************************************************************************
003   *                            usercp_activate.php
004   *                            -------------------
005   *   begin                : Saturday, Feb 13, 2001
006   *   copyright            : (C) 2001 The phpBB Group
007   *   email                : support@phpbb.com
008   *
009   *   $Id$
010   *
011   *
012   ***************************************************************************/
013   
014  /***************************************************************************
015   *
016   *   This program is free software; you can redistribute it and/or modify
017   *   it under the terms of the GNU General Public License as published by
018   *   the Free Software Foundation; either version 2 of the License, or
019   *   (at your option) any later version.
020   *
021   *
022   ***************************************************************************/
023   
024  if ( !defined('IN_PHPBB') )
025  {
026      die('Hacking attempt');
027      exit;
028  }
029   
030  $sql = "SELECT user_active, user_id, username, user_email, user_newpasswd, user_lang, user_actkey 
031      FROM " . USERS_TABLE . "
032      WHERE user_id = " . intval($HTTP_GET_VARS[POST_USERS_URL]);
033  if ( !($result = $db->sql_query($sql)) )
034  {
035      message_die(GENERAL_ERROR, 'Could not obtain user information', '', __LINE__, __FILE__, $sql);
036  }
037   
038  if ( $row = $db->sql_fetchrow($result) )
039  {
040      if ( $row['user_active'] && trim($row['user_actkey']) == '' )
041      {
042          $template->assign_vars(array(
043              'META' => '<meta http-equiv="refresh" content="10;url=' . append_sid("index.$phpEx") . '">')
044          );
045   
046          message_die(GENERAL_MESSAGE, $lang['Already_activated']);
047      }
048      else if ((trim($row['user_actkey']) == trim($HTTP_GET_VARS['act_key'])) && (trim($row['user_actkey']) != ''))
049      {
050          if (intval($board_config['require_activation']) == USER_ACTIVATION_ADMIN && $row['user_newpasswd'] == '')
051          {
052              if (!$userdata['session_logged_in'])
053              {
054                  redirect(append_sid('login.' . $phpEx . '?redirect=profile.' . $phpEx . '&mode=activate&' . POST_USERS_URL . '=' . $row['user_id'] . '&act_key=' . trim($HTTP_GET_VARS['act_key'])));
055              }
056              else if ($userdata['user_level'] != ADMIN)
057              {
058                  message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
059              }
060          }
061   
062          $sql_update_pass = ( $row['user_newpasswd'] != '' ) ? ", user_password = '" . str_replace("\'", "''", $row['user_newpasswd']) . "', user_newpasswd = ''" : '';
063   
064          $sql = "UPDATE " . USERS_TABLE . "
065              SET user_active = 1, user_actkey = ''" . $sql_update_pass . 
066              WHERE user_id = " . $row['user_id']; 
067          if ( !($result = $db->sql_query($sql)) )
068          {
069              message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql_update);
070          }
071   
072          if ( intval($board_config['require_activation']) == USER_ACTIVATION_ADMIN && $sql_update_pass == '' )
073          {
074              include($phpbb_root_path . 'includes/emailer.'.$phpEx);
075              $emailer = new emailer($board_config['smtp_delivery']);
076   
077              $emailer->from($board_config['board_email']);
078              $emailer->replyto($board_config['board_email']);
079   
080              $emailer->use_template('admin_welcome_activated', $row['user_lang']);
081              $emailer->email_address($row['user_email']);
082              $emailer->set_subject($lang['Account_activated_subject']);
083   
084              $emailer->assign_vars(array(
085                  'SITENAME' => $board_config['sitename'], 
086                  'USERNAME' => $row['username'],
087                  'PASSWORD' => $password_confirm,
088                  'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '')
089              );
090              $emailer->send();
091              $emailer->reset();
092   
093              $template->assign_vars(array(
094                  'META' => '<meta http-equiv="refresh" content="10;url=' . append_sid("index.$phpEx") . '">')
095              );
096   
097              message_die(GENERAL_MESSAGE, $lang['Account_active_admin']);
098          }
099          else
100          {
101              $template->assign_vars(array(
102                  'META' => '<meta http-equiv="refresh" content="10;url=' . append_sid("index.$phpEx") . '">')
103              );
104   
105              $message = ( $sql_update_pass == '' ) ? $lang['Account_active'] : $lang['Password_activated']; 
106              message_die(GENERAL_MESSAGE, $message);
107          }
108      }
109      else
110      {
111          message_die(GENERAL_MESSAGE, $lang['Wrong_activation']);
112      }
113  }
114  else
115  {
116      message_die(GENERAL_MESSAGE, $lang['No_such_user']);
117  }
118   
119  ?>