SF.net SVN: postfixadmin:[1661] trunk/model/CliEdit.php
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2014-04-27 13:41:43
|
Revision: 1661 http://sourceforge.net/p/postfixadmin/code/1661 Author: christian_boltz Date: 2014-04-27 13:41:41 +0000 (Sun, 27 Apr 2014) Log Message: ----------- 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 Modified Paths: -------------- trunk/model/CliEdit.php Modified: trunk/model/CliEdit.php =================================================================== --- trunk/model/CliEdit.php 2014-04-27 13:34:03 UTC (rev 1660) +++ trunk/model/CliEdit.php 2014-04-27 13:41:41 UTC (rev 1661) @@ -17,9 +17,7 @@ public function execute() { if (empty($this->args)) { $this->__interactive(); - } - - if (!empty($this->args[0])) { + } else { $this->__handle_params(); } } @@ -76,7 +74,8 @@ $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'] . ')'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |