Guest User

Untitled

a guest
Feb 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php
  2. include('<$MTCGIServerPath$>/php/mt.php');
  3. $mt = new MT(<$MTBlogID$>, '<$MTConfigFile$>');
  4. $db =& $mt->db;
  5. $config = $db->fetch_plugin_config('MT Protect');
  6. if($_REQUEST['rand'] == $config['rand']) {
  7. setcookie($_REQUEST['obj_type'].$_REQUEST['id'], 1, time()+60*60*24, '/');
  8. }
  9.  
  10. $config['rand'] = md5(time().mt_rand());
  11.  
  12. require_once("<$MTCGIServerPath$>/php/lib/MTSerialize.php");
  13. $serializer = new MTSerialize();
  14. $data = $serializer->serialize($config);
  15.  
  16. $put_config_back = $db->get_results("update mt_plugindata set plugindata_data = '$data' where plugindata_plugin = 'MT Protect' and plugindata_key = 'configuration'", ARRAY_A);
  17. header('Location: '. $_REQUEST['redirect']);
  18. ?>
Add Comment
Please, Sign In to add comment