diff --git a/admin_config.php b/admin_config.php index 63f8bc3..09a52e2 100644 --- a/admin_config.php +++ b/admin_config.php @@ -221,22 +221,31 @@ function checkPage() if(!$sfs->sfsCheck($sfsdata)) { //print_a("not a spammer"); - e107::getMessage()->addSuccess("User is not a spammer."); - $this->redirect('list'); - return; + e107::getMessage()->addSuccess("User {$userdata['user_loginname']} is not a spambot."); // TODO LAN } - // else { - print_a("spammer!!"); + e107::getMessage()->addWarning("User {$userdata['user_loginname']} is probably a spambot."); // TODO LAN + } - //$this->redirect('list'); + $this->redirect('list'); return; } function reportPage() { + if(!e107::getPlugPref('sfs', 'sfs_apikey')) + { + e107::getMessage()->addError("You need to enter your API Key in order to use this functionality!"); // TODO LAN + $this->redirect('list'); + return; + } + + $userID = $this->getId(); + $apiKey = e107::getPlugPref('sfs', 'sfs_apikey'); + + // TODO - https://www.stopforumspam.com/usage e107::getMessage()->addWarning("Not functional yet."); $this->redirect('list'); @@ -283,21 +292,23 @@ public function onUpdateError($new_data, $old_data, $id) // left-panel help menu area public function renderHelp() { + $text = ''; - if($this->getAction() == "prefs") + if($this->getAction() == "list") { - $text = ''; - $caption = LAN_HELP; + $text .= 'TODO. Add more info about check and report.'; // TODO add help text + } + if($this->getAction() == "prefs") + { $text .= ''.LAN_SFS_PREFS_DEBUG.''; $text .= '

'.LAN_SFS_PREFS_DEBUG_HELP.'

'; - /*$text .= ''.LAN_SFS_PREFS_APIKEY.''; - $text .= '

'.LAN_SFS_PREFS_APIKEY_HELP.'

';*/ + $text .= ''.LAN_SFS_PREFS_APIKEY.''; + $text .= '

'.LAN_SFS_PREFS_APIKEY_HELP.'

'; } - - return array('caption' => $caption,'text' => $text); + return array('caption' => LAN_HELP, 'text' => $text); } /* @@ -326,9 +337,9 @@ function options($parms, $value, $id, $options) $text = "
"; //$text .= $this->renderValue('options', $value, $attributes, $id); - // $text .= $this->admin_button('report_sfs['.$id.']', $id, 'default', $icon); + //$text .= $this->admin_button('report_sfs['.$id.']', $id, 'default', $icon); $text .= "".$icon_check.""; - $text .= "".$icon_report.""; + //$text .= "".$icon_report.""; $text .= "
"; return $text;