[svn-commits] anthonyl: branch anthonyl/5240-testing r43204 - /team/anthonyl/5240-testing/m...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Mon Sep 18 11:35:29 MST 2006


Author: anthonyl
Date: Mon Sep 18 13:35:29 2006
New Revision: 43204

URL: http://svn.digium.com/view/asterisk?rev=43204&view=rev
Log:
5240 patch integration part3

Modified:
    team/anthonyl/5240-testing/main/manager.c

Modified: team/anthonyl/5240-testing/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/5240-testing/main/manager.c?rev=43204&r1=43203&r2=43204&view=diff
==============================================================================
--- team/anthonyl/5240-testing/main/manager.c (original)
+++ team/anthonyl/5240-testing/main/manager.c Mon Sep 18 13:35:29 2006
@@ -508,8 +508,8 @@
 " Display all the infos related to the manager foobar.\n";
 
 static struct ast_cli_entry show_managers_cli =
-	{ { "manager", "show", "users" },
-	handle_showmanagers, "Show all managers users (connected or not)", showmanagers_help };
+	{ { "manager", "list", "users" },
+	handle_showmanagers, "List all managers users (connected or not)", showmanagers_help };
 
 static struct ast_cli_entry show_manager_cli =
 { { "manager", "show", "user" }, handle_showmanager, "Display information on a specific manager", showmanager_help};
@@ -2569,6 +2569,60 @@
 		ast_log(LOG_WARNING, "Unable to change management port / enabled\n");
 #endif
 	}
+
+
+
+		cat = ast_category_browse(cfg, NULL);
+		amus=NULL; /* Resetting the boss */
+		while(cat) {
+			if (!strcasecmp(cat, "general")) {
+				ast_log(LOG_NOTICE, "ignoring the cat general\n");
+				cat = ast_category_browse(cfg, cat);
+				continue;
+			}
+
+			struct ast_manager_user *amu = malloc(sizeof(struct ast_manager_user));
+			memset(amu, 0, sizeof(struct ast_manager_user));
+			struct ast_variable *var;
+			var = ast_variable_browse(cfg, cat);
+
+			while (var) {
+				if (!strcasecmp(var->name, "secret")) {
+					if (amu->secret)
+						free(amu->secret);
+					amu->secret=strdup(var->value);
+				} else if (!strcasecmp(var->name, "deny") ) {
+					if (amu->deny)
+						free(amu->deny);
+					amu->deny=strdup(var->value);
+				} else if (!strcasecmp(var->name, "permit") ) {
+					if (amu->permit)
+						free(amu->permit);
+					amu->permit=strdup(var->value);
+				}  else if (!strcasecmp(var->name, "read") ) {
+					if (amu->read)
+						free(amu->read);
+					amu->read=strdup(var->value);
+				}  else if (!strcasecmp(var->name, "write") ) {
+					if (amu->write)
+						free(amu->write);
+					amu->write=strdup(var->value);
+				}  else if (!strcasecmp(var->name, "displayconnects") ) {
+					amu->displayconnects=ast_true(var->value);
+				} else {
+					ast_log(LOG_DEBUG, "%s is unknown.\n",var->name);
+				}
+				var = var->next;
+			}
+
+			ast_copy_string(amu->username,cat,sizeof(amu->username));
+
+			ast_log(LOG_DEBUG, "Adding %s\n",amu->username);
+			ast_manager_user_add(amu);
+			amu=NULL;
+			cat = ast_category_browse(cfg, cat);
+		}
+
 	ast_config_destroy(cfg);
 
 	if (webenabled && enabled) {



More information about the svn-commits mailing list