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,10 +7,10 @@ class DBCrypt {
7 7
    * @return encrypted string or false if DB key not accessible
8 8
    */
9 9
   public static function encrypt($plaintext) {
10
-    if (apc_exists('DBKEY')) {
10
+    if (apcu_exists('DBKEY')) {
11 11
       $iv_size = openssl_cipher_iv_length('AES-128-CBC');
12 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 14
       return $ret;
15 15
     } else {
16 16
       return false;
@@ -24,11 +24,11 @@ class DBCrypt {
24 24
    * @return decrypted string string or false if DB key not accessible
25 25
    */
26 26
   public static function decrypt($ciphertext) {
27
-    if (apc_exists('DBKEY')) {
27
+    if (apcu_exists('DBKEY')) {
28 28
       $iv_size = openssl_cipher_iv_length('AES-128-CBC');
29 29
       $iv = substr(base64_decode($ciphertext), 0, $iv_size);
30 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 32
     } else {
33 33
       return false;
34 34
     }

+ 3
- 3
classes/script_start.php View File

@@ -190,7 +190,7 @@ if (isset($_COOKIE['session']) && isset($_COOKIE['userid'])) {
190 190
      "UPDATE users_sessions
191 191
       SET ";
192 192
     // Only update IP if we have an encryption key in memory
193
-    if (apc_exists('DBKEY')) {
193
+    if (apcu_exists('DBKEY')) {
194 194
       $SessionQuery .= "IP = '".DBCrypt::encrypt($_SERVER['REMOTE_ADDR'])."', ";
195 195
     }
196 196
     $SessionQuery .=
@@ -206,7 +206,7 @@ if (isset($_COOKIE['session']) && isset($_COOKIE['userid'])) {
206 206
         'SessionID' => $SessionID,
207 207
         'Browser' => $Browser,
208 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 210
         'LastUpdate' => sqltime() );
211 211
     $Cache->insert_front($SessionID, $UsersSessionCache);
212 212
     $Cache->commit_transaction(0);
@@ -232,7 +232,7 @@ if (isset($_COOKIE['session']) && isset($_COOKIE['userid'])) {
232 232
 
233 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 237
     if (Tools::site_ban_ip($_SERVER['REMOTE_ADDR'])) {
238 238
       error('Your IP address has been banned.');

+ 1
- 1
design/privatefooter.php View File

@@ -24,7 +24,7 @@
24 24
 <?  if (!empty($LastActive)) { ?>
25 25
   <p>
26 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 28
     </a>
29 29
   </p>
30 30
 <?  } ?>

+ 1
- 1
design/privateheader.php View File

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

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

@@ -78,7 +78,7 @@ $DB->query("
78 78
 
79 79
 $JsonMessages = array();
80 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 82
   $JsonMessage = array(
83 83
     'messageId' => (int)$MessageID,
84 84
     'senderId' => (int)$SenderID,

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

@@ -4,7 +4,7 @@ if (!isset($_GET['emails']) || !is_array($_GET['emails'])) {
4 4
   error("Stop that.");
5 5
 }
6 6
 
7
-if (!apc_exists('DBKEY')) {
7
+if (!apcu_exists('DBKEY')) {
8 8
   error(403);
9 9
 }
10 10
 

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

@@ -7,7 +7,7 @@ if (!isset($_POST['emails']) || !is_array($_POST['emails'])) {
7 7
   error("Stop that.");
8 8
 }
9 9
 
10
-if (!apc_exists('DBKEY')) {
10
+if (!apcu_exists('DBKEY')) {
11 11
   error(403);
12 12
 }
13 13
 

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

@@ -83,7 +83,7 @@ $DB->query("
83 83
 <?
84 84
 
85 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 88
   <div class="box vertical_space">
89 89
     <div class="head" style="overflow: hidden;">

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

@@ -27,7 +27,7 @@ $DB->query("
27 27
   WHERE m.ID = '$PostID'
28 28
     AND u.UserID = ".$LoggedUser['ID']);
29 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 32
 // This gets sent to the browser, which echoes it wherever
33 33
 

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

@@ -46,7 +46,7 @@ if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'recover') {
46 46
         AND i.ResetKey != ''");
47 47
     list($UserID, $Email, $Country, $Expires) = $DB->next_record();
48 48
 
49
-    if (!apc_exists('DBKEY')) {
49
+    if (!apcu_exists('DBKEY')) {
50 50
       error('Database not fully decrypted. Please wait for staff to fix this and try again later');
51 51
     }
52 52
 
@@ -114,7 +114,7 @@ if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'recover') {
114 114
     if (!empty($_REQUEST['email'])) {
115 115
       // User has entered email and submitted form
116 116
       $Err = $Validate->ValidateForm($_REQUEST);
117
-      if (!apc_exists('DBKEY')) {
117
+      if (!apcu_exists('DBKEY')) {
118 118
         $Err = 'Database not fully decrypted. Please wait for staff to fix this and try again.';
119 119
       }
120 120
 
@@ -254,7 +254,7 @@ else {
254 254
             if ($Enabled == 1) {
255 255
 
256 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 258
                 $DB->query("
259 259
                   SELECT IP
260 260
                   FROM users_history_ips
@@ -310,14 +310,14 @@ else {
310 310
                 INSERT INTO users_sessions
311 311
                   (UserID, SessionID, KeepLogged, Browser, OperatingSystem, IP, LastUpdate, FullUA)
312 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 315
               $Cache->begin_transaction("users_sessions_$UserID");
316 316
               $Cache->insert_front($SessionID, array(
317 317
                   'SessionID' => $SessionID,
318 318
                   'Browser' => $Browser,
319 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 321
                   'LastUpdate' => sqltime()
322 322
                   ));
323 323
               $Cache->commit_transaction(0);

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

@@ -41,7 +41,7 @@ if (!empty($_REQUEST['confirm'])) {
41 41
   $Val->SetFields('agereq', true, 'checkbox', 'You did not select the box that says you are 18 years of age or older.');
42 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 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,7 +1,7 @@
1 1
 <?
2 2
 //------------- Disable inactive user accounts --------------------------//
3 3
 
4
-if (apc_exists('DBKEY')) {
4
+if (apcu_exists('DBKEY')) {
5 5
   // Send email
6 6
   $DB->query("
7 7
     SELECT um.Username, um.Email

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

@@ -86,8 +86,8 @@ $DB->set_query_id($RS);
86 86
     </tr>
87 87
 <?
88 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 92
     <tr class="row">
93 93
       <td><?=Users::format_username($UserID, true, true, true, true)?></td>

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

@@ -109,10 +109,10 @@ if ($DB->has_results()) {
109 109
 <?
110 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 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 117
     <tr class="<?=$RowClass?>">
118 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,7 +11,7 @@ if (isset($_POST['dbkey'])) {
11 11
   if (!FEATURE_SET_ENC_KEY_PUBLIC) {
12 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 17
 View::show_header('Database Encryption Key');
@@ -21,7 +21,7 @@ View::show_header('Database Encryption Key');
21 21
   <h2>Database Encryption Key</h2>
22 22
 </div>
23 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 25
   <form class="create_form" name="db_key" action="" method="post">
26 26
     <input type="hidden" name="action" value="database_key" />
27 27
     <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />

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

@@ -866,8 +866,8 @@ echo $Pages;
866 866
     </tr>
867 867
 <?
868 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 872
     <tr>
873 873
       <td><?=Users::format_username($UserID, true, true, true, true)?></td>

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

@@ -29,7 +29,7 @@ list($Username, $TwoFactor, $Email, $IRCKey, $Paranoia, $Info, $Avatar, $StyleID
29 29
 
30 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 34
 if ($UserID != $LoggedUser['ID'] && !check_perms('users_edit_profiles', $Class)) {
35 35
   error(403);

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

@@ -190,7 +190,7 @@ if (!empty($Pending)) {
190 190
 <?
191 191
   foreach ($Pending as $Invite) {
192 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 195
       <tr class="row">
196 196
         <td><?=display_str($Email)?></td>
@@ -219,7 +219,7 @@ if (!empty($Pending)) {
219 219
 <?
220 220
   foreach ($Invited as $User) {
221 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 224
       <tr class="row">
225 225
         <td><?=Users::format_username($ID, true, true, true, true)?></td>

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

@@ -73,7 +73,7 @@ View::show_header($Username.' &gt; Sessions');
73 73
 <?
74 74
   foreach ($UserSessions as $Session) {
75 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 78
       <tr class="row">
79 79
         <td class="nobr"><?=$IP?></td>

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

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

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

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

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

@@ -15,7 +15,7 @@ if (!$_POST['userid'] || !is_number($_POST['userid'])) {
15 15
 authorize();
16 16
 // End checking for moronity
17 17
 
18
-if (!apc_exists('DBKEY')) {
18
+if (!apcu_exists('DBKEY')) {
19 19
   error('Decrypt database first');
20 20
 }
21 21
 

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

@@ -133,7 +133,7 @@ $RequiredRatio, $Enabled, $Paranoia, $Invites, $CustomTitle, $torrent_pass,
133 133
 $DisableLeech, $JoinDate, $Info, $Avatar, $FLTokens, $BonusPoints, $IRCLines, $Donor, $Warned,
134 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 138
 $DB->query("
139 139
   SELECT SUM(t.Size)
@@ -588,7 +588,7 @@ if ($ParanoiaLevel == 0) {
588 588
 <?  }
589 589
 
590 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 593
         <li>IP: <?=Tools::display_ip($IP)?></li>
594 594
         <li>Host: <?=Tools::get_host_by_ajax($IP)?></li>
@@ -1440,8 +1440,8 @@ if (!$DisablePoints) {
1440 1440
 <?
1441 1441
       foreach ($Emails as $Email) {
1442 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 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,7 +109,7 @@ foreach ($History as $Key => $Values) {
109 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 114
   <tr class="row">
115 115
     <td><?=display_str($Values['Email'])?></td>
@@ -128,7 +128,7 @@ foreach ($History as $Key => $Values) {
128 128
             AND ue.UserID != $UserID
129 129
             AND um.ID = ue.UserID");
130 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 133
   </tr>
134 134
   <tr>

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

@@ -182,9 +182,9 @@ if ($Old ?? false) {
182 182
       <td>Set from IP</td>
183 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 189
     <tr class="row">
190 190
       <td><?=display_str($Current['Email'])?></td>
@@ -211,7 +211,7 @@ $Current['IP'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Current['IP']) : '[Encr
211 211
 if ($CurrentMatches ?? false) {
212 212
   // Match on the current email
213 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 216
     <tr class="row">
217 217
       <td><?=$Match['Username']?></td>
@@ -279,8 +279,8 @@ if ($Old ?? false) {
279 279
     $Matches = ob_get_contents();
280 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 285
     <tr class="row">
286 286
       <td><?=display_str($Record['Email'])?><?=(($MatchCount > 0) ? ' <a data-toggle-target="#matches_'.$j.'">('.$MatchCount.')</a>' : '')?></td>
@@ -325,7 +325,7 @@ if ($OldMatches ?? false) {
325 325
       ++$i;
326 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 330
     <tr class="row hidden" id="matches_invite">
331 331
       <td><?=$Match['Username']?></td>
@@ -349,8 +349,8 @@ $MatchCount = $i;
349 349
 $Matches = ob_get_contents();
350 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 355
     <tr class="row">
356 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,7 +10,7 @@ if (!check_perms('users_mod') && !$Self) {
10 10
   error(403);
11 11
 }
12 12
 
13
-if (!apc_exists('DBKEY')) {
13
+if (!apcu_exists('DBKEY')) {
14 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,7 +187,7 @@ $CanManageIPBans = check_perms('admin_manage_ipbans');
187 187
 foreach ($Results as $Index => $Result) {
188 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 192
   $HasDupe = false;
193 193
   $UserIDs = explode('|', $UserIDs);

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

@@ -49,7 +49,7 @@ $DB->query("
49 49
   </tr>
50 50
 <?
51 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 54
   <tr class="row">
55 55
     <td><?=time_diff($ChangeTime)?></td>

Loading…
Cancel
Save