| version 1.79, 2008/07/30 13:10:59 |
version 1.80, 2008/07/31 16:00:16 |
| Line 1140 function ezin_substitute_basic_propertie |
|
| Line 1140 function ezin_substitute_basic_propertie |
|
| } |
} |
| |
|
| if (is_array($ezin_cgi)) foreach ($ezin_cgi as $key => $val) { |
if (is_array($ezin_cgi)) foreach ($ezin_cgi as $key => $val) { |
| if (strncmp($key, 'email_', 6) && strncmp($key, 'message_', 8) && strncmp($key, 'feedback_', 9)) { |
if (strncmp($key, 'email_', 6) && strncmp($key, 'message_', 8) && strncmp($key, 'feedback_', 9) && strncmp($key, 'author_', 7)) { |
| continue; |
continue; |
| } |
} |
| if (is_array($val)) { |
if (is_array($val)) { |
| $val = join(',', $val); |
$val = join(',', $val); |
| } |
} |
| |
//echo "$key:$val"; |
| $tmpl_obj->set($key, $val); |
$tmpl_obj->set($key, $val); |
| $tmpl_obj->set("ezin_$key", $val); |
$tmpl_obj->set("ezin_$key", $val); |
| } |
} |
| Line 1502 function ezin_cgi_parse() /* {{{ */ |
|
| Line 1503 function ezin_cgi_parse() /* {{{ */ |
|
| $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 (ezin_check_antispam('F')) { |
if (ezin_check_antispam('F')) { |
| |
$ezin_cgi['feedback_save_antispam_protection'] = 1; |
| $ezin_cgi['feedback_save_error'] = 1; |
$ezin_cgi['feedback_save_error'] = 1; |
| } else { |
} else { |
| $data = array(); |
$data = array(); |
| Line 1518 function ezin_cgi_parse() /* {{{ */ |
|
| Line 1520 function ezin_cgi_parse() /* {{{ */ |
|
| if (ezin_save_feedback($ezin_cgi['section_id'], $data)) { |
if (ezin_save_feedback($ezin_cgi['section_id'], $data)) { |
| $ezin_cgi['feedback_save_ok'] = 1; |
$ezin_cgi['feedback_save_ok'] = 1; |
| } else { |
} else { |
| |
$ezin_cgi['feedback_save_unknown_error'] = 1; |
| $ezin_cgi['feedback_save_error'] = 1; |
$ezin_cgi['feedback_save_error'] = 1; |
| } |
} |
| } |
} |
| } /* }}} */ |
} /* }}} */ |
| if (! empty($ezin_save_email)) { /* {{{ */ |
if (! empty($ezin_save_email)) { /* {{{ */ |
| if (ezin_check_antispam('N')) { |
if (ezin_check_antispam('N')) { |
| |
$ezin_cgi['email_save_antispam_protection'] = 1; |
| $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 1531 function ezin_cgi_parse() /* {{{ */ |
|
| Line 1535 function ezin_cgi_parse() /* {{{ */ |
|
| if (Validate::email($email) && ezin_save_email($ezin_cgi['section_id'], $email)) { |
if (Validate::email($email) && ezin_save_email($ezin_cgi['section_id'], $email)) { |
| $ezin_cgi['email_save_ok'] = 1; |
$ezin_cgi['email_save_ok'] = 1; |
| } else { |
} else { |
| |
$ezin_cgi['email_save_unknown_error'] = 1; |
| $ezin_cgi['email_save_error'] = 1; |
$ezin_cgi['email_save_error'] = 1; |
| } |
} |
| } |
} |
| } /* }}} */ |
} /* }}} */ |
| 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 (ezin_check_antispam('A')) { |
if (ezin_check_antispam('A')) { |
| |
$ezin_cgi['author_save_antispam_protection'] = 1; |
| $ezin_cgi['author_save_error'] = 1; |
$ezin_cgi['author_save_error'] = 1; |
| } else { |
} else { |
| $data = array(); |
$logged_in = strlen($ezin_user['username']) > 0; |
| |
$data = array(); |
| foreach ($_POST + $_GET as $key => $val) { |
foreach ($_POST + $_GET as $key => $val) { |
| if (in_array($key, array('ezin_save_author', 'ezin_fragment', |
if (in_array($key, array('ezin_save_author', 'ezin_fragment', |
| 'ezin_section_id', 'ezin_section_key', 'ezin_antispam'))) { |
'ezin_section_id', 'ezin_section_key', 'ezin_antispam'))) { |
| Line 1549 function ezin_cgi_parse() /* {{{ */ |
|
| Line 1556 function ezin_cgi_parse() /* {{{ */ |
|
| $data[$matches[1]] = htmlspecialchars(stripslashes($val)); |
$data[$matches[1]] = htmlspecialchars(stripslashes($val)); |
| } |
} |
| } |
} |
| if (strlen($ezin_user['username']) > 0) { // logged in |
if ($logged_in) { |
| $data['username'] = $ezin_user['username']; |
$data['username'] = $ezin_user['username']; |
| $data['author_id'] = $ezin_user['author_id']; |
$data['author_id'] = $ezin_user['author_id']; |
| } |
if (! ezin_exists_author($data['username'])) { |
| $exists = ezin_exists_author($data['username']); |
$ezin_cgi['author_save_error'] = 1; |
| ezin_author_send_notify_email($data); |
$ezin_cgi['author_save_not_exists'] = 1; |
| if (ezin_save_author($data)) { |
} elseif (strlen($data['password'].$data['password_repeat']) > 0 && $data['password'] != $data['password_repeat']) { |
| $ezin_cgi['author_save_ok'] = 1; |
$ezin_cgi['author_save_password_not_match'] = 1; |
| |
$ezin_cgi['author_save_error'] = 1; |
| |
} elseif (strlen($data['password'].$data['password_repeat']) > 0 && strlen($data['password']) < 4) { |
| |
$ezin_cgi['author_save_password_too_short'] = 1; |
| |
$ezin_cgi['author_save_error'] = 1; |
| |
} else { |
| |
if (ezin_update_author($data)) { |
| |
$ezin_cgi['author_save_ok'] = 1; |
| |
} else { |
| |
$ezin_cgi['author_save_unknown_error'] = 1; |
| |
$ezin_cgi['author_save_error'] = 1; |
| |
} |
| |
} |
| } else { |
} else { |
| $ezin_cgi['author_save_error'] = 1; |
if (ezin_exists_author($data['username'])) { |
| |
$ezin_cgi['author_save_error'] = 1; |
| |
$ezin_cgi['author_save_already_exists'] = 1; |
| |
} elseif (! preg_match('|^[a-z][a-z0-9-]{1,32}$|', $data['username'])) { |
| |
$ezin_cgi['author_save_bad_username'] = 1; |
| |
$ezin_cgi['author_save_error'] = 1; |
| |
} elseif ($data['password'] != $data['password_repeat']) { |
| |
$ezin_cgi['author_save_password_not_match'] = 1; |
| |
$ezin_cgi['author_save_error'] = 1; |
| |
} elseif (strlen($data['password']) < 4) { |
| |
$ezin_cgi['author_save_password_too_short'] = 1; |
| |
$ezin_cgi['author_save_error'] = 1; |
| |
} else { |
| |
if (ezin_insert_author($data)) { |
| |
$ezin_cgi['author_save_ok'] = 1; |
| |
} else { |
| |
$ezin_cgi['athor_save_unknown_error'] = 1; |
| |
$ezin_cgi['author_save_error'] = 1; |
| |
} |
| |
} |
| } |
} |
| |
ezin_author_send_notify_email($data); |
| } |
} |
| } /* }}} */ |
} /* }}} */ |
| } |
} |