EOC; $jscode[] = <<Neues Passwort setzen','',height+'px',width+'px'); passwd_popup.contentDiv.style.backgroundColor='#e0e0e0'; passwd_popup.contentDiv.innerHTML = [ '
', '', '
', '', '
', '
', '', '
', '
', '', '
', '', '
', ].join(''); } var edit_username = document.getElementById('edit_username'); var edit_vmail_domain_id = document.getElementById('edit_vmail_domain_id'); var pw_id = document.getElementById('pw_id'); var pw_email = document.getElementById('pw_email'); pw_id.value = edit_id.value; pw_email.value = edit_username.value + '@' + edit_vmail_domain_id.options[edit_vmail_domain_id.selectedIndex].innerHTML; var x = Math.floor((RicoUtil.windowWidth()-width)/2); var y = Math.floor((RicoUtil.windowHeight()-height)/2); passwd_popup.openPopup(x,y); var pw_pass1 = document.getElementById('pw_pass1'); pw_pass1.focus(); return false; } EOC; $mask = array( 'table' => 'vmail_user', 'title' => 'Mailboxen und Weiterleitungen', 'join' => array('vmail_domain ON vmail_domain_id = vmail_domain.id'), 'list' => array( 'id' => array( 'name' => 'ID', 'visible' => false, 'sql' => 'vmail_user.id', ), 'email' => array( 'name' => 'E-Mail', 'width' => 330, 'type' => 'text', 'sql' => "username || '@' || name", 'specs' => "filterUI: 't'", ), 'forward' => array( 'name' => 'Forward', 'width' => 330, 'specs' => "filterUI: 't'", ), 'pw' => array( 'name' => 'Pass', 'width' => 40, 'specs' => "ClassName: 'aligncenter'", 'control' => "new Rico.TableColumn.checkbox('t', 'f',0,1)", 'sql' => 'password IS NOT NULL AND length(password) > 0', ), 'active' => array( 'name' => 'on', 'width' => 40, 'specs' => "ClassName: 'aligncenter'", 'control' => "new Rico.TableColumn.checkbox(1, 0,0,1)", ), ), 'edit' => array( 'username' => array( 'name' => 'Usename', 'type' => 'text', 'size' => 21, 'required' => true, ), 'vmail_domain_id' => array( 'name' => 'Domain', 'type' => 'select', 'options' => 'SELECT id,name AS text FROM vmail_domain ORDER BY name', 'option_empty' => '-- select --', 'required' => true, ), 'forward' => array( 'name' => 'Forward', 'type' => 'text', 'size' => 21, 'null' => true, ), /* 'password' => array( 'name' => 'Passwort', 'type' => 'passwd', 'size' => 21, 'null' => true, 'func' => 'passwd_encrypt', ), */ 'active' => array( 'name' => 'aktiviert', 'type' => 'boolean', ), 'buttons' => array( 'type' => 'html', 'code' => $buttons, 'sql' => false, ), ), 'callbacks' => array( 'delete' => 'cb_delete', 'setpw' => 'cb_setpw', ), ); function passwd_encrypt($pw) { return md5($pw); } function cb_delete() { global $db; $sql = sprintf("UPDATE vmail_user SET password = NULL WHERE id = %d", $_POST['id']); $sth = $db->query($sql); return true; } function cb_setpw() { global $db; $sql = sprintf("UPDATE vmail_user SET password = '%s' WHERE id = %d", passwd_encrypt($_POST['passwd']), $_POST['id']); $sth = $db->query($sql); return true; } ?>