/** * Create form tag with correct module call */ function sumo_get_form_req($module = '', $action = '', $parameters = '', $method = 'POST', $options = '') { $m = $module ? $module : $_SESSION['module']; $a = $action ? $action : $_SESSION['action']; switch (strtoupper($method)) { case '': case 'POST': $method = 'POST'; break; case 'GET': $method = 'GET'; break; } if (preg_match("/onsubmit\\=/i", $options)) { $end = substr($options, strlen($options) - 1, 1); $sep = $end == "'" ? "\"" : "'"; $onsubmit = substr($options, 0, strlen($options) - 1) . ";sumo_ajax_post(" . $sep . $m . ".content" . $sep . ",this);return false;" . $end; $options = ""; } else { $onsubmit = "onSubmit=\"javascript:sumo_ajax_post('{$m}.content',this);return false;\""; } $form = "<form method='{$method}' " . "action='?module={$m}&action={$a}&{$parameters}&decoration=false' " . $onsubmit . " name='" . sumo_get_form_name($m, $a) . "' {$options}>\n"; return $form; }
<?php /** * SUMO MODULE: Users | Edit password * * @version 0.5.0 * @link http://sumoam.sourceforge.net SUMO Access Manager * @author Alberto Basso <*****@*****.**> * @copyright Copyright © 2003-2009, Alberto Basso * @package SUMO * @category Console */ $tpl = array('MESSAGE:H' => $tpl['MESSAGE:H'], 'MESSAGE:M' => $tpl['MESSAGE:M'], 'MESSAGE:L' => $tpl['MESSAGE:L'], 'PUT:NewPassword' => "<input type='password' class='password' size='20' name='new_password' autocomplete='off'>", 'PUT:ReNewPassword' => "<input type='password' class='password' size='20' name='renew_password' autocomplete='off'>", 'GET:FormName' => sumo_get_form_name('', 'modify_password'), 'GET:UpdateForm' => sumo_get_form_req('', 'modify_password'), 'BUTTON:Save' => '<input type="submit" class="button-green" value="' . $language["Save"] . '">', 'BUTTON:Cancel' => '<input type="button" class="button-red" value="' . $language["Cancel"] . '" onClick="sumo_remove_window(\'users\');">', 'GET:WindowScripts' => $tpl['GET:WindowScripts']);