| version 1.55, 2007/02/24 21:11:02 |
version 1.56, 2007/02/24 22:07:24 |
|
|
| * http://platon.sk/projects/Metafox/ |
* http://platon.sk/projects/Metafox/ |
| */ |
*/ |
| |
|
| /* $Platon: Metafox/functions.inc.php,v 1.54 2007-02-24 19:27:03 nepto Exp $ */ |
/* $Platon: Metafox/functions.inc.php,v 1.55 2007-02-24 21:11:02 nepto Exp $ */ |
| |
|
| function ezin_eval($evalcode) /* {{{ */ |
function ezin_eval($evalcode) /* {{{ */ |
| { |
{ |
| Line 1013 function ezin_substitute_basic_propertie |
|
| Line 1013 function ezin_substitute_basic_propertie |
|
| 'ezin_time' => sprintf('%.2f', Platon::get_mtime() - @$ezin_sys['time']['start']), |
'ezin_time' => sprintf('%.2f', Platon::get_mtime() - @$ezin_sys['time']['start']), |
| |
|
| // Antispam |
// Antispam |
| 'ezin_antispam_question' => $ezin_cfg['antispam_question'], |
'ezin_antispam_question' => ezin_check_antispam() ? $ezin_cfg['antispam_question'] : '', |
| 'ezin_antispam_answer' => $ezin_cfg['antispam_answer'], |
'ezin_antispam_answer' => ezin_check_antispam() ? $ezin_cfg['antispam_answer'] : '', |
| |
|
| // Ezin software |
// Ezin software |
| 'ezin_software_name' => @$ezin_sys['software']['name'], |
'ezin_software_name' => @$ezin_sys['software']['name'], |
| Line 1275 function ezin_cgi_parse() /* {{{ */ |
|
| Line 1275 function ezin_cgi_parse() /* {{{ */ |
|
| } |
} |
| |
|
| $result = true; |
$result = true; |
| if (stristr($ezin_cfg['antispam_flags'], 'M') != false |
if (ezin_check_antispam('M')) { |
| && strlen(trim($ezin_cfg['antispam_answer'])) > 0 |
|
| && strcasecmp(trim($ezin_cfg['antispam_answer']), trim($_REQUEST['ezin_antispam']))) { |
|
| $ezin_cgi['message_save_antispam_protection'] = 1; |
$ezin_cgi['message_save_antispam_protection'] = 1; |
| $result = false; |
$result = false; |
| } |
} |
| Line 1368 function ezin_cgi_parse() /* {{{ */ |
|
| Line 1366 function ezin_cgi_parse() /* {{{ */ |
|
| $ezin_save_email = Platon::parse_id_param('ezin_save_email', false); |
$ezin_save_email = Platon::parse_id_param('ezin_save_email', false); |
| $ezin_save_author = Platon::parse_id_param('ezin_save_author', false); |
$ezin_save_author = Platon::parse_id_param('ezin_save_author', false); |
| if (! empty($ezin_save_feedback)) { /* {{{ */ |
if (! empty($ezin_save_feedback)) { /* {{{ */ |
| if (stristr($ezin_cfg['antispam_flags'], 'F') != false |
if (ezin_check_antispam('F')) { |
| && strlen(trim($ezin_cfg['antispam_answer'])) > 0 |
|
| && strcasecmp(trim($ezin_cfg['antispam_answer']), trim($_REQUEST['ezin_antispam']))) { |
|
| $ezin_cgi['feedback_save_error'] = 1; |
$ezin_cgi['feedback_save_error'] = 1; |
| } else { |
} else { |
| $data = array(); |
$data = array(); |
| Line 1402 function ezin_cgi_parse() /* {{{ */ |
|
| Line 1398 function ezin_cgi_parse() /* {{{ */ |
|
| } |
} |
| } /* }}} */ |
} /* }}} */ |
| if (! empty($ezin_save_email)) { /* {{{ */ |
if (! empty($ezin_save_email)) { /* {{{ */ |
| if (stristr($ezin_cfg['antispam_flags'], 'N') != false |
if (ezin_check_antispam('N')) { |
| && strlen(trim($ezin_cfg['antispam_answer'])) > 0 |
|
| && strcasecmp(trim($ezin_cfg['antispam_answer']), trim($_REQUEST['ezin_antispam']))) { |
|
| $ezin_cgi['email_save_error'] = 1; |
$ezin_cgi['email_save_error'] = 1; |
| } else { |
} else { |
| $email = trim($_REQUEST['ezin_email']); |
$email = trim($_REQUEST['ezin_email']); |
| Line 1417 function ezin_cgi_parse() /* {{{ */ |
|
| Line 1411 function ezin_cgi_parse() /* {{{ */ |
|
| } |
} |
| } /* }}} */ |
} /* }}} */ |
| if (! empty($ezin_save_author) && $ezin_cfg['user_create_role_id'] > 0) { /* {{{ */ |
if (! empty($ezin_save_author) && $ezin_cfg['user_create_role_id'] > 0) { /* {{{ */ |
| if (stristr($ezin_cfg['antispam_flags'], 'A') != false |
if (ezin_check_antispam('A')) { |
| && strlen(trim($ezin_cfg['antispam_answer'])) > 0 |
|
| && strcasecmp(trim($ezin_cfg['antispam_answer']), trim($_REQUEST['ezin_antispam']))) { |
|
| $ezin_cgi['author_save_error'] = 1; |
$ezin_cgi['author_save_error'] = 1; |
| } else { |
} else { |
| $data = array(); |
$data = array(); |
| Line 1435 function ezin_cgi_parse() /* {{{ */ |
|
| Line 1427 function ezin_cgi_parse() /* {{{ */ |
|
| ezin_author_send_notify_email($data); |
ezin_author_send_notify_email($data); |
| if (ezin_save_author($data)) { |
if (ezin_save_author($data)) { |
| $ezin_cgi['author_save_ok'] = 1; |
$ezin_cgi['author_save_ok'] = 1; |
| if ($ezin_cfg['author_save_redirect']) { |
$request_uri = $_SERVER['REQUEST_URI']; |
| $request_uri = $_SERVER['REQUEST_URI']; |
$location = strpos($request_uri, '?') === false |
| $location = strpos($request_uri, '?') === false |
? ezin_get_link('S', $ezin_cgi['section_id'], 1, @$ezin_cgi['lang']) |
| ? ezin_get_link('S', $ezin_cgi['section_id'], 1, @$ezin_cgi['lang']) |
: 'http://'.$_SERVER['HTTP_HOST'].$request_uri; |
| : 'http://'.$_SERVER['HTTP_HOST'].$request_uri; |
if (strlen(@$_POST['ezin_fragment']) > 0) { |
| if (strlen(@$_POST['ezin_fragment']) > 0) { |
$location .= '#'.$_POST['ezin_fragment']; |
| $location .= '#'.$_POST['ezin_fragment']; |
|
| } |
|
| Platon::redirect($location); |
|
| } |
} |
| |
Platon::redirect($location); |
| } else { |
} else { |
| $ezin_cgi['author_save_error'] = 1; |
$ezin_cgi['author_save_error'] = 1; |
| } |
} |
| Line 1458 function ezin_cgi_parse() /* {{{ */ |
|
| Line 1448 function ezin_cgi_parse() /* {{{ */ |
|
| |
|
| $ezin_edit_author = Platon::parse_id_param('ezin_edit_author', false); |
$ezin_edit_author = Platon::parse_id_param('ezin_edit_author', false); |
| if (! empty($ezin_edit_author)) { |
if (! empty($ezin_edit_author)) { |
| $ezin_cgi['output'] = 'author_edit'; |
$ezin_cgi['output'] = 'author_edit'; |
| } |
} |
| |
|
| $poll_answer_id = Platon::parse_id_param('ezin_poll_answer_id', 0); |
$poll_answer_id = Platon::parse_id_param('ezin_poll_answer_id', 0); |
| Line 1491 function ezin_cgi_parse() /* {{{ */ |
|
| Line 1481 function ezin_cgi_parse() /* {{{ */ |
|
| } |
} |
| } /* }}} */ |
} /* }}} */ |
| |
|
| |
function ezin_check_antispam($flag = '') /* {{{ */ |
| |
{ |
| |
global $ezin_cfg, $ezin_cgi; |
| |
if (strlen($flag) > 0) { |
| |
/* we have flag, so we are going to check answer */ |
| |
return (stristr($ezin_cfg['antispam_flags'], $flag) != false |
| |
&& strlen(trim($ezin_cfg['antispam_answer'])) > 0 |
| |
&& strcasecmp(trim($ezin_cfg['antispam_answer']), trim($_REQUEST['ezin_antispam']))); |
| |
} |
| |
/* we do not have any flag */ |
| |
switch ($ezin_cgi['output']) { |
| |
case 'message': |
| |
case 'message_edit': |
| |
return stristr($ezin_cfg['antispam_flags'], 'M'); |
| |
case 'author_edit': |
| |
return stristr($ezin_cfg['antispam_flags'], 'A'); |
| |
case 'section': // feedback? |
| |
return stristr($ezin_cfg['antispam_flags'], 'F'); |
| |
// newletter not implemented and is always true |
| |
} |
| |
return true; |
| |
} /* }}} */ |
| |
|
| /* |
/* |
| * dir_app - directory application related functions |
* dir_app - directory application related functions |
| */ |
*/ |