eb461c006ac627d3d5c0fb5e8b4819fe81bebed9
Author: Mark Story
Date: 2009-07-22 23:17:39 -0400
diff --git a/vendors/shells/api_index.php b/vendors/shells/api_index.php
index fbe6df6..73b677b 100644
--- a/vendors/shells/api_index.php
+++ b/vendors/shells/api_index.php
@@ -356,17 +356,18 @@ class ApiIndexShell extends Shell {
**/
public function users() {
$config = $this->config();
- if (empty($config['users']) || isset($this->args[0]) && low($this->args[0]) == 'add') {
- $this->_addUsers($config);
- }
- $add = $this->_listUsers($config);
- if ($add == 'y') {
+ if (empty($config['users']) || isset($this->args[0]) && strtolower($this->args[0]) == 'add') {
$config = $this->_addUsers($config);
- $string = $this->ApiConfig->toString($config);
- if ($this->ApiConfig->save($string)) {
- $this->out('The config was saved');
+ } else {
+ $add = $this->_listUsers($config);
+ if (strtolower($add) == 'y') {
+ $config = $this->_addUsers($config);
}
}
+ $string = $this->ApiConfig->toString($config);
+ if ($this->ApiConfig->save($string)) {
+ $this->out('The config was saved');
+ }
}
/**
* List users in the config file.
