CliEdit.php:

- execute(): call __handle_params() also if empty args[0] is given
- __interactive(): only ask for id if $id_field is editable

This fixes two issues with a non-editable auto_increment id field


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1661 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 10 years ago
parent da14ddf6d7
commit bbd7c3af77

@ -17,9 +17,7 @@ class CliEdit extends Shell {
public function execute() {
if (empty($this->args)) {
$this->__interactive();
}
if (!empty($this->args[0])) {
} else {
$this->__handle_params();
}
}
@ -76,7 +74,8 @@ class CliEdit extends Shell {
$form_fields = $handler->getStruct();
$id_field = $handler->getId_field();
while(0==0) { # endlees loop - except if input is valid
$values[$id_field] = '';
while($form_fields[$id_field]['editable'] != 0) { # endlees loop - except if input is valid or id_field is not editable (like auto_increment)
$question = $form_fields[$id_field]['label'] . ":";
if ( $form_fields[$id_field]['desc'] != '') {
$question .= "\n(" . $form_fields[$id_field]['desc'] . ')';

Loading…
Cancel
Save