Browse Source

Only require apcu, not apcu_bc

Fixes #27
spaghetti 8 years ago
parent
commit
29a4e15e2f

+ 4
- 4
classes/dbcrypt.class.php View File

7
    * @return encrypted string or false if DB key not accessible
7
    * @return encrypted string or false if DB key not accessible
8
    */
8
    */
9
   public static function encrypt($plaintext) {
9
   public static function encrypt($plaintext) {
10
-    if (apc_exists('DBKEY')) {
10
+    if (apcu_exists('DBKEY')) {
11
       $iv_size = openssl_cipher_iv_length('AES-128-CBC');
11
       $iv_size = openssl_cipher_iv_length('AES-128-CBC');
12
       $iv = openssl_random_pseudo_bytes($iv_size);
12
       $iv = openssl_random_pseudo_bytes($iv_size);
13
-      $ret =  base64_encode($iv.openssl_encrypt($plaintext, 'AES-128-CBC', apc_fetch('DBKEY'), OPENSSL_RAW_DATA, $iv));
13
+      $ret =  base64_encode($iv.openssl_encrypt($plaintext, 'AES-128-CBC', apcu_fetch('DBKEY'), OPENSSL_RAW_DATA, $iv));
14
       return $ret;
14
       return $ret;
15
     } else {
15
     } else {
16
       return false;
16
       return false;
24
    * @return decrypted string string or false if DB key not accessible
24
    * @return decrypted string string or false if DB key not accessible
25
    */
25
    */
26
   public static function decrypt($ciphertext) {
26
   public static function decrypt($ciphertext) {
27
-    if (apc_exists('DBKEY')) {
27
+    if (apcu_exists('DBKEY')) {
28
       $iv_size = openssl_cipher_iv_length('AES-128-CBC');
28
       $iv_size = openssl_cipher_iv_length('AES-128-CBC');
29
       $iv = substr(base64_decode($ciphertext), 0, $iv_size);
29
       $iv = substr(base64_decode($ciphertext), 0, $iv_size);
30
       $ciphertext = substr(base64_decode($ciphertext), $iv_size);
30
       $ciphertext = substr(base64_decode($ciphertext), $iv_size);
31
-      return openssl_decrypt($ciphertext, 'AES-128-CBC', apc_fetch('DBKEY'), OPENSSL_RAW_DATA, $iv);
31
+      return openssl_decrypt($ciphertext, 'AES-128-CBC', apcu_fetch('DBKEY'), OPENSSL_RAW_DATA, $iv);
32
     } else {
32
     } else {
33
       return false;
33
       return false;
34
     }
34
     }

+ 3
- 3
classes/script_start.php View File

190
      "UPDATE users_sessions
190
      "UPDATE users_sessions
191
       SET ";
191
       SET ";
192
     // Only update IP if we have an encryption key in memory
192
     // Only update IP if we have an encryption key in memory
193
-    if (apc_exists('DBKEY')) {
193
+    if (apcu_exists('DBKEY')) {
194
       $SessionQuery .= "IP = '".DBCrypt::encrypt($_SERVER['REMOTE_ADDR'])."', ";
194
       $SessionQuery .= "IP = '".DBCrypt::encrypt($_SERVER['REMOTE_ADDR'])."', ";
195
     }
195
     }
196
     $SessionQuery .=
196
     $SessionQuery .=
206
         'SessionID' => $SessionID,
206
         'SessionID' => $SessionID,
207
         'Browser' => $Browser,
207
         'Browser' => $Browser,
208
         'OperatingSystem' => $OperatingSystem,
208
         'OperatingSystem' => $OperatingSystem,
209
-        'IP' => ((apc_exists('DBKEY')) ? DBCrypt::encrypt($_SERVER['REMOTE_ADDR']) : $UserSessions[$SessionID]['IP']),
209
+        'IP' => ((apcu_exists('DBKEY')) ? DBCrypt::encrypt($_SERVER['REMOTE_ADDR']) : $UserSessions[$SessionID]['IP']),
210
         'LastUpdate' => sqltime() );
210
         'LastUpdate' => sqltime() );
211
     $Cache->insert_front($SessionID, $UsersSessionCache);
211
     $Cache->insert_front($SessionID, $UsersSessionCache);
212
     $Cache->commit_transaction(0);
212
     $Cache->commit_transaction(0);
232
 
232
 
233
   // IP changed
233
   // IP changed
234
 
234
 
235
-  if (apc_exists('DBKEY') && DBCrypt::decrypt($LoggedUser['IP']) != $_SERVER['REMOTE_ADDR'] && !check_perms('site_disable_ip_history')) {
235
+  if (apcu_exists('DBKEY') && DBCrypt::decrypt($LoggedUser['IP']) != $_SERVER['REMOTE_ADDR'] && !check_perms('site_disable_ip_history')) {
236
 
236
 
237
     if (Tools::site_ban_ip($_SERVER['REMOTE_ADDR'])) {
237
     if (Tools::site_ban_ip($_SERVER['REMOTE_ADDR'])) {
238
       error('Your IP address has been banned.');
238
       error('Your IP address has been banned.');

+ 1
- 1
design/privatefooter.php View File

24
 <?  if (!empty($LastActive)) { ?>
24
 <?  if (!empty($LastActive)) { ?>
25
   <p>
25
   <p>
26
     <a href="user.php?action=sessions">
26
     <a href="user.php?action=sessions">
27
-      <span class="tooltip" title="Manage sessions">Last activity: </span><?=time_diff($LastActive['LastUpdate'])?><span class="tooltip" title="Manage sessions"> from <?=(apc_exists('DBKEY')?(DBCrypt::decrypt($LastActive['IP'])):'[Encrypted]') ?></span>
27
+      <span class="tooltip" title="Manage sessions">Last activity: </span><?=time_diff($LastActive['LastUpdate'])?><span class="tooltip" title="Manage sessions"> from <?=(apcu_exists('DBKEY')?(DBCrypt::decrypt($LastActive['IP'])):'[Encrypted]') ?></span>
28
     </a>
28
     </a>
29
   </p>
29
   </p>
30
 <?  } ?>
30
 <?  } ?>

+ 1
- 1
design/privateheader.php View File

538
           <?=implode(' | ', $ModBar); echo "\n"?>
538
           <?=implode(' | ', $ModBar); echo "\n"?>
539
         </div>
539
         </div>
540
 <?  }
540
 <?  }
541
-if (check_perms('site_debug') && !apc_exists('DBKEY')) { ?>
541
+if (check_perms('site_debug') && !apcu_exists('DBKEY')) { ?>
542
         <div class="alertbar" style="color: white; background: #B53939;">
542
         <div class="alertbar" style="color: white; background: #B53939;">
543
           Warning: <a href="tools.php?action=database_key">no DB key</a>
543
           Warning: <a href="tools.php?action=database_key">no DB key</a>
544
         </div>
544
         </div>

+ 1
- 1
sections/ajax/inbox/viewconv.php View File

78
 
78
 
79
 $JsonMessages = array();
79
 $JsonMessages = array();
80
 while (list($SentDate, $SenderID, $Body, $MessageID) = $DB->next_record()) {
80
 while (list($SentDate, $SenderID, $Body, $MessageID) = $DB->next_record()) {
81
-  $Body = apc_exists('DBKEY') ? DBCrypt::decrypt($Body) : '[Encrypted]';
81
+  $Body = apcu_exists('DBKEY') ? DBCrypt::decrypt($Body) : '[Encrypted]';
82
   $JsonMessage = array(
82
   $JsonMessage = array(
83
     'messageId' => (int)$MessageID,
83
     'messageId' => (int)$MessageID,
84
     'senderId' => (int)$SenderID,
84
     'senderId' => (int)$SenderID,

+ 1
- 1
sections/delete/delete_email.php View File

4
   error("Stop that.");
4
   error("Stop that.");
5
 }
5
 }
6
 
6
 
7
-if (!apc_exists('DBKEY')) {
7
+if (!apcu_exists('DBKEY')) {
8
   error(403);
8
   error(403);
9
 }
9
 }
10
 
10
 

+ 1
- 1
sections/delete/take_delete_email.php View File

7
   error("Stop that.");
7
   error("Stop that.");
8
 }
8
 }
9
 
9
 
10
-if (!apc_exists('DBKEY')) {
10
+if (!apcu_exists('DBKEY')) {
11
   error(403);
11
   error(403);
12
 }
12
 }
13
 
13
 

+ 1
- 1
sections/inbox/conversation.php View File

83
 <?
83
 <?
84
 
84
 
85
 while (list($SentDate, $SenderID, $Body, $MessageID) = $DB->next_record()) {
85
 while (list($SentDate, $SenderID, $Body, $MessageID) = $DB->next_record()) {
86
-  $Body = apc_exists('DBKEY') ? DBCrypt::decrypt($Body) : '[Encrypted]';
86
+  $Body = apcu_exists('DBKEY') ? DBCrypt::decrypt($Body) : '[Encrypted]';
87
 ?>
87
 ?>
88
   <div class="box vertical_space">
88
   <div class="box vertical_space">
89
     <div class="head" style="overflow: hidden;">
89
     <div class="head" style="overflow: hidden;">

+ 1
- 1
sections/inbox/get_post.php View File

27
   WHERE m.ID = '$PostID'
27
   WHERE m.ID = '$PostID'
28
     AND u.UserID = ".$LoggedUser['ID']);
28
     AND u.UserID = ".$LoggedUser['ID']);
29
 list($Body) = $DB->next_record(MYSQLI_NUM);
29
 list($Body) = $DB->next_record(MYSQLI_NUM);
30
-$Body = apc_exists('DBKEY') ? DBCrypt::decrypt($Body) : '[Encrypted]';
30
+$Body = apcu_exists('DBKEY') ? DBCrypt::decrypt($Body) : '[Encrypted]';
31
 
31
 
32
 // This gets sent to the browser, which echoes it wherever
32
 // This gets sent to the browser, which echoes it wherever
33
 
33
 

+ 5
- 5
sections/login/index.php View File

46
         AND i.ResetKey != ''");
46
         AND i.ResetKey != ''");
47
     list($UserID, $Email, $Country, $Expires) = $DB->next_record();
47
     list($UserID, $Email, $Country, $Expires) = $DB->next_record();
48
 
48
 
49
-    if (!apc_exists('DBKEY')) {
49
+    if (!apcu_exists('DBKEY')) {
50
       error('Database not fully decrypted. Please wait for staff to fix this and try again later');
50
       error('Database not fully decrypted. Please wait for staff to fix this and try again later');
51
     }
51
     }
52
 
52
 
114
     if (!empty($_REQUEST['email'])) {
114
     if (!empty($_REQUEST['email'])) {
115
       // User has entered email and submitted form
115
       // User has entered email and submitted form
116
       $Err = $Validate->ValidateForm($_REQUEST);
116
       $Err = $Validate->ValidateForm($_REQUEST);
117
-      if (!apc_exists('DBKEY')) {
117
+      if (!apcu_exists('DBKEY')) {
118
         $Err = 'Database not fully decrypted. Please wait for staff to fix this and try again.';
118
         $Err = 'Database not fully decrypted. Please wait for staff to fix this and try again.';
119
       }
119
       }
120
 
120
 
254
             if ($Enabled == 1) {
254
             if ($Enabled == 1) {
255
 
255
 
256
               // Check if the current login attempt is from a location previously logged in from
256
               // Check if the current login attempt is from a location previously logged in from
257
-              if (apc_exists('DBKEY')) {
257
+              if (apcu_exists('DBKEY')) {
258
                 $DB->query("
258
                 $DB->query("
259
                   SELECT IP
259
                   SELECT IP
260
                   FROM users_history_ips
260
                   FROM users_history_ips
310
                 INSERT INTO users_sessions
310
                 INSERT INTO users_sessions
311
                   (UserID, SessionID, KeepLogged, Browser, OperatingSystem, IP, LastUpdate, FullUA)
311
                   (UserID, SessionID, KeepLogged, Browser, OperatingSystem, IP, LastUpdate, FullUA)
312
                 VALUES
312
                 VALUES
313
-                  ('$UserID', '".db_string($SessionID)."', '1', '$Browser', '$OperatingSystem', '".db_string(apc_exists('DBKEY')?DBCrypt::encrypt($_SERVER['REMOTE_ADDR']):'0.0.0.0')."', '".sqltime()."', '".db_string($_SERVER['HTTP_USER_AGENT'])."')");
313
+                  ('$UserID', '".db_string($SessionID)."', '1', '$Browser', '$OperatingSystem', '".db_string(apcu_exists('DBKEY')?DBCrypt::encrypt($_SERVER['REMOTE_ADDR']):'0.0.0.0')."', '".sqltime()."', '".db_string($_SERVER['HTTP_USER_AGENT'])."')");
314
 
314
 
315
               $Cache->begin_transaction("users_sessions_$UserID");
315
               $Cache->begin_transaction("users_sessions_$UserID");
316
               $Cache->insert_front($SessionID, array(
316
               $Cache->insert_front($SessionID, array(
317
                   'SessionID' => $SessionID,
317
                   'SessionID' => $SessionID,
318
                   'Browser' => $Browser,
318
                   'Browser' => $Browser,
319
                   'OperatingSystem' => $OperatingSystem,
319
                   'OperatingSystem' => $OperatingSystem,
320
-                  'IP' => (apc_exists('DBKEY')?DBCrypt::encrypt($_SERVER['REMOTE_ADDR']):'0.0.0.0'),
320
+                  'IP' => (apcu_exists('DBKEY')?DBCrypt::encrypt($_SERVER['REMOTE_ADDR']):'0.0.0.0'),
321
                   'LastUpdate' => sqltime()
321
                   'LastUpdate' => sqltime()
322
                   ));
322
                   ));
323
               $Cache->commit_transaction(0);
323
               $Cache->commit_transaction(0);

+ 1
- 1
sections/register/index.php View File

41
   $Val->SetFields('agereq', true, 'checkbox', 'You did not select the box that says you are 18 years of age or older.');
41
   $Val->SetFields('agereq', true, 'checkbox', 'You did not select the box that says you are 18 years of age or older.');
42
   //$Val->SetFields('captcha', true, 'string', 'You did not enter a captcha code.', array('minlength' => 6, 'maxlength' => 6));
42
   //$Val->SetFields('captcha', true, 'string', 'You did not enter a captcha code.', array('minlength' => 6, 'maxlength' => 6));
43
 
43
 
44
-  if (!apc_exists('DBKEY')) {
44
+  if (!apcu_exists('DBKEY')) {
45
     $Err = "Registration temporarily disabled due to degraded database access (security measure)";
45
     $Err = "Registration temporarily disabled due to degraded database access (security measure)";
46
   }
46
   }
47
 
47
 

+ 1
- 1
sections/schedule/daily/disable_inactive_users.php View File

1
 <?
1
 <?
2
 //------------- Disable inactive user accounts --------------------------//
2
 //------------- Disable inactive user accounts --------------------------//
3
 
3
 
4
-if (apc_exists('DBKEY')) {
4
+if (apcu_exists('DBKEY')) {
5
   // Send email
5
   // Send email
6
   $DB->query("
6
   $DB->query("
7
     SELECT um.Username, um.Email
7
     SELECT um.Username, um.Email

+ 2
- 2
sections/tools/data/invite_pool.php View File

86
     </tr>
86
     </tr>
87
 <?
87
 <?
88
   while (list($UserID, $IP, $InviteKey, $Expires, $Email) = $DB->next_record()) {
88
   while (list($UserID, $IP, $InviteKey, $Expires, $Email) = $DB->next_record()) {
89
-    $IP = apc_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
90
-    $Email = apc_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]';
89
+    $IP = apcu_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
90
+    $Email = apcu_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]';
91
 ?>
91
 ?>
92
     <tr class="row">
92
     <tr class="row">
93
       <td><?=Users::format_username($UserID, true, true, true, true)?></td>
93
       <td><?=Users::format_username($UserID, true, true, true, true)?></td>

+ 4
- 4
sections/tools/data/registration_log.php View File

109
 <?
109
 <?
110
   while (list($UserID, $IP, $IPCC, $Email, $Username, $PermissionID, $Uploaded, $Downloaded, $Enabled, $Donor, $Warned, $Joined, $Uses, $InviterID, $InviterIP, $InviterIPCC, $InviterEmail, $InviterUsername, $InviterPermissionID, $InviterUploaded, $InviterDownloaded, $InviterEnabled, $InviterDonor, $InviterWarned, $InviterJoined, $InviterUses) = $DB->next_record()) {
110
   while (list($UserID, $IP, $IPCC, $Email, $Username, $PermissionID, $Uploaded, $Downloaded, $Enabled, $Donor, $Warned, $Joined, $Uses, $InviterID, $InviterIP, $InviterIPCC, $InviterEmail, $InviterUsername, $InviterPermissionID, $InviterUploaded, $InviterDownloaded, $InviterEnabled, $InviterDonor, $InviterWarned, $InviterJoined, $InviterUses) = $DB->next_record()) {
111
   $RowClass = $IP === $InviterIP ? 'warning' : '';
111
   $RowClass = $IP === $InviterIP ? 'warning' : '';
112
-  $Email = apc_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]';
113
-  $IP = apc_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
114
-  $InviterEmail = apc_exists('DBKEY') ? DBCrypt::decrypt($InviterEmail) : '[Encrypted]';
115
-  $InviterIP = apc_exists('DBKEY') ? DBCrypt::decrypt($InviterIP) : '[Encrypted]';
112
+  $Email = apcu_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]';
113
+  $IP = apcu_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
114
+  $InviterEmail = apcu_exists('DBKEY') ? DBCrypt::decrypt($InviterEmail) : '[Encrypted]';
115
+  $InviterIP = apcu_exists('DBKEY') ? DBCrypt::decrypt($InviterIP) : '[Encrypted]';
116
 ?>
116
 ?>
117
     <tr class="<?=$RowClass?>">
117
     <tr class="<?=$RowClass?>">
118
       <td><?=Users::format_username($UserID, true, true, true, true)?><br /><?=Users::format_username($InviterID, true, true, true, true)?></td>
118
       <td><?=Users::format_username($UserID, true, true, true, true)?><br /><?=Users::format_username($InviterID, true, true, true, true)?></td>

+ 2
- 2
sections/tools/misc/database_key.php View File

11
   if (!FEATURE_SET_ENC_KEY_PUBLIC) {
11
   if (!FEATURE_SET_ENC_KEY_PUBLIC) {
12
     authorize();
12
     authorize();
13
   }
13
   }
14
-  apc_store('DBKEY', hash('sha512', $_POST['dbkey']));
14
+  apcu_store('DBKEY', hash('sha512', $_POST['dbkey']));
15
 }
15
 }
16
 
16
 
17
 View::show_header('Database Encryption Key');
17
 View::show_header('Database Encryption Key');
21
   <h2>Database Encryption Key</h2>
21
   <h2>Database Encryption Key</h2>
22
 </div>
22
 </div>
23
 <div class="box pad slight_margin">
23
 <div class="box pad slight_margin">
24
-  <h4>There is <?=((apc_exists('DBKEY') && apc_fetch('DBKEY'))?"already a":"NO")?> key loaded</h4>
24
+  <h4>There is <?=((apcu_exists('DBKEY') && apcu_fetch('DBKEY'))?"already a":"NO")?> key loaded</h4>
25
   <form class="create_form" name="db_key" action="" method="post">
25
   <form class="create_form" name="db_key" action="" method="post">
26
     <input type="hidden" name="action" value="database_key" />
26
     <input type="hidden" name="action" value="database_key" />
27
     <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
27
     <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />

+ 2
- 2
sections/user/advancedsearch.php View File

866
     </tr>
866
     </tr>
867
 <?
867
 <?
868
 while (list($UserID, $Username, $Uploaded, $Downloaded, $Snatched, $Invitees, $Class, $Email, $Enabled, $IP, $Invites, $DisableInvites, $Warned, $Donor, $JoinDate, $LastAccess) = $DB->next_record()) {
868
 while (list($UserID, $Username, $Uploaded, $Downloaded, $Snatched, $Invitees, $Class, $Email, $Enabled, $IP, $Invites, $DisableInvites, $Warned, $Donor, $JoinDate, $LastAccess) = $DB->next_record()) {
869
-  $IP = apc_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
870
-  $Email = apc_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]';
869
+  $IP = apcu_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
870
+  $Email = apcu_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]';
871
 ?>
871
 ?>
872
     <tr>
872
     <tr>
873
       <td><?=Users::format_username($UserID, true, true, true, true)?></td>
873
       <td><?=Users::format_username($UserID, true, true, true, true)?></td>

+ 1
- 1
sections/user/edit.php View File

29
 
29
 
30
 $TwoFA = new TwoFactorAuth();
30
 $TwoFA = new TwoFactorAuth();
31
 
31
 
32
-$Email = apc_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]';
32
+$Email = apcu_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]';
33
 
33
 
34
 if ($UserID != $LoggedUser['ID'] && !check_perms('users_edit_profiles', $Class)) {
34
 if ($UserID != $LoggedUser['ID'] && !check_perms('users_edit_profiles', $Class)) {
35
   error(403);
35
   error(403);

+ 2
- 2
sections/user/invite.php View File

190
 <?
190
 <?
191
   foreach ($Pending as $Invite) {
191
   foreach ($Pending as $Invite) {
192
     list($InviteKey, $Email, $Expires) = $Invite;
192
     list($InviteKey, $Email, $Expires) = $Invite;
193
-    $Email = apc_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]';
193
+    $Email = apcu_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]';
194
 ?>
194
 ?>
195
       <tr class="row">
195
       <tr class="row">
196
         <td><?=display_str($Email)?></td>
196
         <td><?=display_str($Email)?></td>
219
 <?
219
 <?
220
   foreach ($Invited as $User) {
220
   foreach ($Invited as $User) {
221
     list($ID, $Email, $Uploaded, $Downloaded, $JoinDate, $LastAccess) = $User;
221
     list($ID, $Email, $Uploaded, $Downloaded, $JoinDate, $LastAccess) = $User;
222
-    $Email = apc_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]'
222
+    $Email = apcu_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]'
223
 ?>
223
 ?>
224
       <tr class="row">
224
       <tr class="row">
225
         <td><?=Users::format_username($ID, true, true, true, true)?></td>
225
         <td><?=Users::format_username($ID, true, true, true, true)?></td>

+ 1
- 1
sections/user/sessions.php View File

73
 <?
73
 <?
74
   foreach ($UserSessions as $Session) {
74
   foreach ($UserSessions as $Session) {
75
     list($ThisSessionID, $Browser, $OperatingSystem, $IP, $LastUpdate) = array_values($Session);
75
     list($ThisSessionID, $Browser, $OperatingSystem, $IP, $LastUpdate) = array_values($Session);
76
-    $IP = apc_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
76
+    $IP = apcu_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
77
 ?>
77
 ?>
78
       <tr class="row">
78
       <tr class="row">
79
         <td class="nobr"><?=$IP?></td>
79
         <td class="nobr"><?=$IP?></td>

+ 1
- 1
sections/user/take_edit.php View File

39
 
39
 
40
 $Err = $Val->ValidateForm($_POST);
40
 $Err = $Val->ValidateForm($_POST);
41
 
41
 
42
-if (!apc_exists('DBKEY')) {
42
+if (!apcu_exists('DBKEY')) {
43
   $Err = "Cannot edit profile until database fully decrypted.";
43
   $Err = "Cannot edit profile until database fully decrypted.";
44
 }
44
 }
45
 
45
 

+ 1
- 1
sections/user/take_invite.php View File

11
 
11
 
12
 $UserID = $LoggedUser['ID'];
12
 $UserID = $LoggedUser['ID'];
13
 
13
 
14
-if (!apc_exists('DBKEY')) {
14
+if (!apcu_exists('DBKEY')) {
15
   error('Invites disabled until database decrypted');
15
   error('Invites disabled until database decrypted');
16
   header('Location: user.php?action=invite');
16
   header('Location: user.php?action=invite');
17
   die();
17
   die();

+ 1
- 1
sections/user/takemoderate.php View File

15
 authorize();
15
 authorize();
16
 // End checking for moronity
16
 // End checking for moronity
17
 
17
 
18
-if (!apc_exists('DBKEY')) {
18
+if (!apcu_exists('DBKEY')) {
19
   error('Decrypt database first');
19
   error('Decrypt database first');
20
 }
20
 }
21
 
21
 

+ 4
- 4
sections/user/user.php View File

133
 $DisableLeech, $JoinDate, $Info, $Avatar, $FLTokens, $BonusPoints, $IRCLines, $Donor, $Warned,
133
 $DisableLeech, $JoinDate, $Info, $Avatar, $FLTokens, $BonusPoints, $IRCLines, $Donor, $Warned,
134
 $ForumPosts, $InviterID, $DisableInvites, $InviterName, $InfoTitle) = $DB->next_record(MYSQLI_NUM, array(9, 11));
134
 $ForumPosts, $InviterID, $DisableInvites, $InviterName, $InfoTitle) = $DB->next_record(MYSQLI_NUM, array(9, 11));
135
 }
135
 }
136
-$Email = apc_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]';
136
+$Email = apcu_exists('DBKEY') ? DBCrypt::decrypt($Email) : '[Encrypted]';
137
 
137
 
138
 $DB->query("
138
 $DB->query("
139
   SELECT SUM(t.Size)
139
   SELECT SUM(t.Size)
588
 <?  }
588
 <?  }
589
 
589
 
590
 if (check_perms('users_view_ips', $Class)) {
590
 if (check_perms('users_view_ips', $Class)) {
591
-  $IP = apc_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
591
+  $IP = apcu_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
592
 ?>
592
 ?>
593
         <li>IP: <?=Tools::display_ip($IP)?></li>
593
         <li>IP: <?=Tools::display_ip($IP)?></li>
594
         <li>Host: <?=Tools::get_host_by_ajax($IP)?></li>
594
         <li>Host: <?=Tools::get_host_by_ajax($IP)?></li>
1440
 <?
1440
 <?
1441
       foreach ($Emails as $Email) {
1441
       foreach ($Emails as $Email) {
1442
         list($Address, $IP) = $Email;
1442
         list($Address, $IP) = $Email;
1443
-        $IP = apc_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
1444
-        $Address = apc_exists('DBKEY') ? DBCrypt::decrypt($Address) : '[Encrypted]';
1443
+        $IP = apcu_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
1444
+        $Address = apcu_exists('DBKEY') ? DBCrypt::decrypt($Address) : '[Encrypted]';
1445
 ?>
1445
 ?>
1446
             <option value="<?=display_str($Address)?>"><?=display_str($Address)?> - <?=display_str($IP)?></option>
1446
             <option value="<?=display_str($Address)?>"><?=display_str($Address)?> - <?=display_str($IP)?></option>
1447
 <?    } ?>
1447
 <?    } ?>

+ 2
- 2
sections/userhistory/email_history.php View File

109
     $Values['Time'] = $Joined;
109
     $Values['Time'] = $Joined;
110
   }
110
   }
111
 
111
 
112
-  $ValuesIP = apc_exists('DBKEY') ? DBCrypt::decrypt($Values['IP']) : '[Encrypted]';
112
+  $ValuesIP = apcu_exists('DBKEY') ? DBCrypt::decrypt($Values['IP']) : '[Encrypted]';
113
 ?>
113
 ?>
114
   <tr class="row">
114
   <tr class="row">
115
     <td><?=display_str($Values['Email'])?></td>
115
     <td><?=display_str($Values['Email'])?></td>
128
             AND ue.UserID != $UserID
128
             AND ue.UserID != $UserID
129
             AND um.ID = ue.UserID");
129
             AND um.ID = ue.UserID");
130
     while (list($UserID2, $Time, $IP) = $DB->next_record()) {
130
     while (list($UserID2, $Time, $IP) = $DB->next_record()) {
131
-      $IP = apc_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
131
+      $IP = apcu_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
132
 ?>
132
 ?>
133
   </tr>
133
   </tr>
134
   <tr>
134
   <tr>

+ 9
- 9
sections/userhistory/email_history2.php View File

182
       <td>Set from IP</td>
182
       <td>Set from IP</td>
183
     </tr>
183
     </tr>
184
 <?
184
 <?
185
-$Current['Email'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Current['Email']) : '[Encrypted]';
186
-$Current['CurrentIP'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Current['CurrentIP']) : '[Encrypted]';
187
-$Current['IP'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Current['IP']) : '[Encrypted]';
185
+$Current['Email'] = apcu_exists('DBKEY') ? DBCrypt::decrypt($Current['Email']) : '[Encrypted]';
186
+$Current['CurrentIP'] = apcu_exists('DBKEY') ? DBCrypt::decrypt($Current['CurrentIP']) : '[Encrypted]';
187
+$Current['IP'] = apcu_exists('DBKEY') ? DBCrypt::decrypt($Current['IP']) : '[Encrypted]';
188
 ?>
188
 ?>
189
     <tr class="row">
189
     <tr class="row">
190
       <td><?=display_str($Current['Email'])?></td>
190
       <td><?=display_str($Current['Email'])?></td>
211
 if ($CurrentMatches ?? false) {
211
 if ($CurrentMatches ?? false) {
212
   // Match on the current email
212
   // Match on the current email
213
   foreach ($CurrentMatches as $Match) {
213
   foreach ($CurrentMatches as $Match) {
214
-    $Match['IP'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Match['IP']) : '[Encrypted]';
214
+    $Match['IP'] = apcu_exists('DBKEY') ? DBCrypt::decrypt($Match['IP']) : '[Encrypted]';
215
 ?>
215
 ?>
216
     <tr class="row">
216
     <tr class="row">
217
       <td><?=$Match['Username']?></td>
217
       <td><?=$Match['Username']?></td>
279
     $Matches = ob_get_contents();
279
     $Matches = ob_get_contents();
280
     ob_end_clean();
280
     ob_end_clean();
281
 
281
 
282
-    $Record['Email'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Record['Email']) : '[Encrypted]';
283
-    $Record['IP'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Record['IP']) : '[Encrypted]';
282
+    $Record['Email'] = apcu_exists('DBKEY') ? DBCrypt::decrypt($Record['Email']) : '[Encrypted]';
283
+    $Record['IP'] = apcu_exists('DBKEY') ? DBCrypt::decrypt($Record['IP']) : '[Encrypted]';
284
 ?>
284
 ?>
285
     <tr class="row">
285
     <tr class="row">
286
       <td><?=display_str($Record['Email'])?><?=(($MatchCount > 0) ? ' <a data-toggle-target="#matches_'.$j.'">('.$MatchCount.')</a>' : '')?></td>
286
       <td><?=display_str($Record['Email'])?><?=(($MatchCount > 0) ? ' <a data-toggle-target="#matches_'.$j.'">('.$MatchCount.')</a>' : '')?></td>
325
       ++$i;
325
       ++$i;
326
       // Match email is the same as the invite email
326
       // Match email is the same as the invite email
327
 
327
 
328
-      $Match['IP'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Match['IP']) : '[Encrypted]';
328
+      $Match['IP'] = apcu_exists('DBKEY') ? DBCrypt::decrypt($Match['IP']) : '[Encrypted]';
329
 ?>
329
 ?>
330
     <tr class="row hidden" id="matches_invite">
330
     <tr class="row hidden" id="matches_invite">
331
       <td><?=$Match['Username']?></td>
331
       <td><?=$Match['Username']?></td>
349
 $Matches = ob_get_contents();
349
 $Matches = ob_get_contents();
350
 ob_end_clean();
350
 ob_end_clean();
351
 
351
 
352
-$Invite['Email'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Invite['Email']) : '[Encrypted]';
353
-$Invite['IP'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Invite['IP']) : '[Encrypted]';
352
+$Invite['Email'] = apcu_exists('DBKEY') ? DBCrypt::decrypt($Invite['Email']) : '[Encrypted]';
353
+$Invite['IP'] = apcu_exists('DBKEY') ? DBCrypt::decrypt($Invite['IP']) : '[Encrypted]';
354
 ?>
354
 ?>
355
     <tr class="row">
355
     <tr class="row">
356
       <td><?=display_str($Invite['Email'])?><?=(($MatchCount > 0) ? ' <a data-toggle-target="#matches_invite">('.$MatchCount.')</a>' : '')?></td>
356
       <td><?=display_str($Invite['Email'])?><?=(($MatchCount > 0) ? ' <a data-toggle-target="#matches_invite">('.$MatchCount.')</a>' : '')?></td>

+ 1
- 1
sections/userhistory/email_history_userview.php View File

10
   error(403);
10
   error(403);
11
 }
11
 }
12
 
12
 
13
-if (!apc_exists('DBKEY')) {
13
+if (!apcu_exists('DBKEY')) {
14
   error('The site is currently running with partial database access. Please wait for staff to fully decrypt it');
14
   error('The site is currently running with partial database access. Please wait for staff to fully decrypt it');
15
 }
15
 }
16
 
16
 

+ 1
- 1
sections/userhistory/ip_history.php View File

187
 foreach ($Results as $Index => $Result) {
187
 foreach ($Results as $Index => $Result) {
188
   list($IP, $StartTime, $EndTime, $UserIDs, $UserStartTimes, $UserEndTimes, $Usernames, $UsersEnabled, $UsersDonor, $UsersWarned) = $Result;
188
   list($IP, $StartTime, $EndTime, $UserIDs, $UserStartTimes, $UserEndTimes, $Usernames, $UsersEnabled, $UsersDonor, $UsersWarned) = $Result;
189
 
189
 
190
-  $IP = apc_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
190
+  $IP = apcu_exists('DBKEY') ? DBCrypt::decrypt($IP) : '[Encrypted]';
191
 
191
 
192
   $HasDupe = false;
192
   $HasDupe = false;
193
   $UserIDs = explode('|', $UserIDs);
193
   $UserIDs = explode('|', $UserIDs);

+ 1
- 1
sections/userhistory/password_history.php View File

49
   </tr>
49
   </tr>
50
 <?
50
 <?
51
 while (list($ChangeTime, $ChangerIP) = $DB->next_record()) {
51
 while (list($ChangeTime, $ChangerIP) = $DB->next_record()) {
52
-  $ChangerIP = (apc_exists('DBKEY')) ? DBCrypt::decrypt($ChangerIP) : '[Encrypted]';
52
+  $ChangerIP = (apcu_exists('DBKEY')) ? DBCrypt::decrypt($ChangerIP) : '[Encrypted]';
53
 ?>
53
 ?>
54
   <tr class="row">
54
   <tr class="row">
55
     <td><?=time_diff($ChangeTime)?></td>
55
     <td><?=time_diff($ChangeTime)?></td>

Loading…
Cancel
Save