remote api keys in their own block

This commit is contained in:
Shish 2009-11-10 03:07:27 +00:00
parent 6bee15164f
commit 247d2b0637
3 changed files with 11 additions and 8 deletions

View File

@ -193,11 +193,6 @@ class CommentList extends SimpleExtension {
$sb->add_label("<br>Show ");
$sb->add_int_option("comment_list_count");
$sb->add_label(" comments per image on the list");
$sb->add_label("<br>&nbsp;<br><a href='http://akismet.com/'>Akismet</a>");
$sb->add_text_option("comment_wordpress_key", "<br>API key: ");
$sb->add_label("<br>&nbsp;<br><a href='http://recaptcha.net/'>ReCAPTCHA</a>");
$sb->add_text_option("comment_recaptcha_privkey", "<br>Private key: ");
$sb->add_text_option("comment_recaptcha_pubkey", "<br>Public key: ");
$event->panel->add_block($sb);
}
@ -344,9 +339,9 @@ class CommentList extends SimpleExtension {
private function is_spam_recaptcha($text) {
global $config, $user;
if(strlen($config->get_string('comment_recaptcha_privkey')) > 0) {
if(strlen($config->get_string('api_recaptcha_privkey')) > 0) {
$resp = recaptcha_check_answer(
$config->get_string('comment_recaptcha_privkey'),
$config->get_string('api_recaptcha_privkey'),
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);

View File

@ -150,7 +150,7 @@ class CommentListTheme extends Themelet {
$i_image_id = int_escape($image_id);
$hash = CommentList::get_hash();
$rpk = $config->get_string("comment_recaptcha_pubkey");
$rpk = $config->get_string("api_recaptcha_pubkey");
$reca = (!$user->is_anonymous() || empty($rpk)) ?
"" : recaptcha_get_html($rpk);
return "

View File

@ -252,6 +252,14 @@ class Setup extends SimpleExtension {
$sb->add_bool_option("nice_urls", "<br>Nice URLs: ");
$sb->add_label("<span id='nicetest'>(Javascript inactive, can't test!)</span>$nicescript");
$event->panel->add_block($sb);
$sb = new SetupBlock("Remote API Integration");
$sb->add_label("<br>&nbsp;<br><a href='http://akismet.com/'>Akismet</a>");
$sb->add_text_option("comment_wordpress_key", "<br>API key: ");
$sb->add_label("<br>&nbsp;<br><a href='http://recaptcha.net/'>ReCAPTCHA</a>");
$sb->add_text_option("api_recaptcha_privkey", "<br>Private key: ");
$sb->add_text_option("api_recaptcha_pubkey", "<br>Public key: ");
$event->panel->add_block($sb);
}
public function onConfigSave($event) {