Don't like ads? PRO users don't see any ads ;-)
Guest

aol_check_install

By: a guest on May 6th, 2012  |  syntax: PHP  |  size: 1.54 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function aol_check_install()
  2. {
  3.         global $config, $db, $user, $phpbb_root_path, $phpEx;
  4.         include($phpbb_root_path . 'includes/db/db_tools.' . $phpEx);
  5.         $aol_db = new phpbb_db_tools($db);
  6.         $aol_mod_enabled = 'aol_mod_enabled';
  7.         if(!isset($config['aol_mod_installed']) || !$aol_db->sql_column_exists(USERS_TABLE, 'user_aol_fail_only') || !$aol_db->sql_column_exists(USERS_TABLE, 'user_aol_alert') ||
  8.         !file_exists($phpbb_root_path . 'language/' . $user->data['user_lang'] . '/email/' . 'alert_on_fail_login.txt') || !file_exists($phpbb_root_path . 'language/' . $user->data['user_lang'] . '/email/' . 'alert_on_fail_login_acp.txt') ||
  9.         !file_exists($phpbb_root_path . 'language/' . $user->data['user_lang'] . '/email/' . 'alert_on_fail_login_acp_founder.txt') || !file_exists($phpbb_root_path . 'language/' . $user->data['user_lang'] . '/email/' . 'alert_on_fail_login_founder.txt') ||
  10.         !file_exists($phpbb_root_path . 'language/' . $user->data['user_lang'] . '/email/' . 'alert_on_success_login.txt') || !file_exists($phpbb_root_path . 'language/' . $user->data['user_lang'] . '/email/' . 'alert_on_success_login_acp.txt') ||
  11.         !file_exists($phpbb_root_path . 'language/' . $user->data['user_lang'] . '/email/' . 'alert_on_success_login_acp_founder.txt'))
  12.         {       //disable mod for avoid any error on the board
  13.                 if(isset($config[$aol_mod_enabled]))
  14.                 {
  15.                         set_config($aol_mod_enabled, 0, false);
  16.                 }
  17.                 //Install error happenned turn false...
  18.                 return false;
  19.         }
  20.         else
  21.         {       //Ok all step succefully checked, so we are fine, return true :D
  22.                 return true;
  23.         }
  24. }
  25. ?>