Browse Source

More json_encode migration and some 2FA fixes

spaghetti 8 years ago
parent
commit
e857952d21
2 changed files with 6 additions and 6 deletions
  1. 5
    5
      classes/users.class.php
  2. 1
    1
      sections/user/take_edit.php

+ 5
- 5
classes/users.class.php View File

95
       } else {
95
       } else {
96
         $UserInfo = G::$DB->next_record(MYSQLI_ASSOC, array('Paranoia', 'Title'));
96
         $UserInfo = G::$DB->next_record(MYSQLI_ASSOC, array('Paranoia', 'Title'));
97
         $UserInfo['CatchupTime'] = strtotime($UserInfo['CatchupTime']);
97
         $UserInfo['CatchupTime'] = strtotime($UserInfo['CatchupTime']);
98
-        $UserInfo['Paranoia'] = unserialize($UserInfo['Paranoia']);
98
+        $UserInfo['Paranoia'] = json_decode($UserInfo['Paranoia'], true);
99
         if ($UserInfo['Paranoia'] === false) {
99
         if ($UserInfo['Paranoia'] === false) {
100
           $UserInfo['Paranoia'] = array();
100
           $UserInfo['Paranoia'] = array();
101
         }
101
         }
182
       $HeavyInfo = G::$DB->next_record(MYSQLI_ASSOC, array('CustomPermissions', 'SiteOptions'));
182
       $HeavyInfo = G::$DB->next_record(MYSQLI_ASSOC, array('CustomPermissions', 'SiteOptions'));
183
 
183
 
184
       if (!empty($HeavyInfo['CustomPermissions'])) {
184
       if (!empty($HeavyInfo['CustomPermissions'])) {
185
-        $HeavyInfo['CustomPermissions'] = unserialize($HeavyInfo['CustomPermissions']);
185
+        $HeavyInfo['CustomPermissions'] = json_decode($HeavyInfo['CustomPermissions'], true);
186
       } else {
186
       } else {
187
         $HeavyInfo['CustomPermissions'] = array();
187
         $HeavyInfo['CustomPermissions'] = array();
188
       }
188
       }
232
         unset($HeavyInfo['CustomForums']['']);
232
         unset($HeavyInfo['CustomForums']['']);
233
       }
233
       }
234
 
234
 
235
-      $HeavyInfo['SiteOptions'] = unserialize($HeavyInfo['SiteOptions']);
235
+      $HeavyInfo['SiteOptions'] = json_decode($HeavyInfo['SiteOptions'], true);
236
       if (!empty($HeavyInfo['SiteOptions'])) {
236
       if (!empty($HeavyInfo['SiteOptions'])) {
237
         $HeavyInfo = array_merge($HeavyInfo, $HeavyInfo['SiteOptions']);
237
         $HeavyInfo = array_merge($HeavyInfo, $HeavyInfo['SiteOptions']);
238
       }
238
       }
268
       FROM users_info
268
       FROM users_info
269
       WHERE UserID = $UserID");
269
       WHERE UserID = $UserID");
270
     list($SiteOptions) = G::$DB->next_record(MYSQLI_NUM, false);
270
     list($SiteOptions) = G::$DB->next_record(MYSQLI_NUM, false);
271
-    $SiteOptions = unserialize($SiteOptions);
271
+    $SiteOptions = json_decode($SiteOptions, true);
272
 
272
 
273
     // Get HeavyInfo
273
     // Get HeavyInfo
274
     $HeavyInfo = Users::user_heavy_info($UserID);
274
     $HeavyInfo = Users::user_heavy_info($UserID);
280
     // Update DB
280
     // Update DB
281
     G::$DB->query("
281
     G::$DB->query("
282
       UPDATE users_info
282
       UPDATE users_info
283
-      SET SiteOptions = '".db_string(serialize($SiteOptions))."'
283
+      SET SiteOptions = '".db_string(json_encode($SiteOptions, true))."'
284
       WHERE UserID = $UserID");
284
       WHERE UserID = $UserID");
285
     G::$DB->set_query_id($QueryID);
285
     G::$DB->set_query_id($QueryID);
286
 
286
 

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

181
 //End email change
181
 //End email change
182
 
182
 
183
 //2FA activation
183
 //2FA activation
184
-if (isset($_POST['twofa'])) {
184
+if (!empty($_POST['twofa'])) {
185
   $DB->query("
185
   $DB->query("
186
     SELECT TwoFactor, PassHash
186
     SELECT TwoFactor, PassHash
187
     FROM users_main
187
     FROM users_main

Loading…
Cancel
Save