bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js
function generateUserInfo(serviceRegistry, keyAssistFunction, prefsService) {
		prefsService.get("/userMenu").then(function(prefs) {
			if (Boolean(prefs) && prefs.disabled === true) {
				var menu = lib.node("userMenu");
				if (Boolean(menu)) {
					menu.parentElement.removeChild(menu);
				}
				return;
			}
			var authServices = serviceRegistry.getServiceReferences("orion.core.auth"); //$NON-NLS-0$
			authenticationIds = [];

			var menuGenerator = customGlobalCommands.createMenuGenerator.call(this, serviceRegistry, keyAssistFunction, prefsService);

			if (!menuGenerator) { return; }

			for (var i = 0; i < authServices.length; i++) {
				var servicePtr = authServices[i];
				var authService = serviceRegistry.getService(servicePtr);
				getLabel(authService, servicePtr).then(function (label) {
					authService.getKey().then(function (key) {
						authenticationIds.push(key);
						authService.getUser().then(function (jsonData) {
							menuGenerator.addUserItem(key, authService, label, jsonData);
						}, function (errorData, jsonData) {
							menuGenerator.addUserItem(key, authService, label, jsonData);
						});
						window.addEventListener("storage", function (e) {
							if (authRendered[key] === localStorage.getItem(key)) {
								return;
							}

							authRendered[key] = localStorage.getItem(key);

							authService.getUser().then(function (jsonData) {
								menuGenerator.addUserItem(key, authService, label, jsonData);
							}, function (errorData) {
								menuGenerator.addUserItem(key, authService, label);
							});
						}, false);
					});
				});
			}
		});
	}
function generateUserInfo(serviceRegistry, keyAssistFunction, prefsService) {
		prefsService.get("/userMenu").then(function(prefs) {
			if (Boolean(prefs) && prefs.disabled === true) {
				var menu = lib.node("userMenu");
				if (Boolean(menu)) {
					menu.parentElement.removeChild(menu);
				}
				return;
			}
			var authServices = serviceRegistry.getServiceReferences("orion.core.auth"); //$NON-NLS-0$
			authenticationIds = [];

			var menuGenerator = customGlobalCommands.createMenuGenerator.call(this, serviceRegistry, keyAssistFunction, prefsService);

			if (!menuGenerator) { return; }

			for (var i = 0; i < authServices.length; i++) {
				var servicePtr = authServices[i];
				var authService = serviceRegistry.getService(servicePtr);
				getLabel(authService, servicePtr).then(function (label) {
					authService.getKey().then(function (key) {
						authenticationIds.push(key);
						authService.getUser().then(function (jsonData) {
							menuGenerator.addUserItem(key, authService, label, jsonData);
						}, function (errorData, jsonData) {
							menuGenerator.addUserItem(key, authService, label, jsonData);
						});
						window.addEventListener("storage", function (e) {
							if (authRendered[key] === localStorage.getItem(key)) {
								return;
							}

							authRendered[key] = localStorage.getItem(key);

							authService.getUser().then(function (jsonData) {
								menuGenerator.addUserItem(key, authService, label, jsonData);
							}, function (errorData) {
								menuGenerator.addUserItem(key, authService, label);
							});
						}, false);
					});
				});
			}
		});
	}
function generateUserInfo ( serviceRegistry , keyAssistFunction , prefsService ) { prefsService . get ( "/userMenu" ) . then ( function ( prefs ) { if ( Boolean ( prefs ) && prefs . disabled === true ) { var menu = lib . node ( "userMenu" ) ; if ( Boolean ( menu ) ) { menu . parentElement . removeChild ( menu ) ; } return ; } var authServices = serviceRegistry . getServiceReferences ( "orion.core.auth" ) ; //$NON-NLS-0$ authenticationIds = [ ] ; var menuGenerator = customGlobalCommands . createMenuGenerator . call ( this , serviceRegistry , keyAssistFunction , prefsService ) ; if ( ! menuGenerator ) { return ; } for ( var i = 0 ; i < authServices . length ; i ++ ) { var servicePtr = authServices [ i ] ; var authService = serviceRegistry . getService ( servicePtr ) ; getLabel ( authService , servicePtr ) . then ( function ( label ) { authService . getKey ( ) . then ( function ( key ) { authenticationIds . push ( key ) ; authService . getUser ( ) . then ( function ( jsonData ) { menuGenerator . addUserItem ( key , authService , label , jsonData ) ; } , function ( errorData , jsonData ) { menuGenerator . addUserItem ( key , authService , label , jsonData ) ; } ) ; window . addEventListener ( "storage" , function ( e ) { if ( authRendered [ key ] === localStorage . getItem ( key ) ) { return ; } authRendered [ key ] = localStorage . getItem ( key ) ; authService . getUser ( ) . then ( function ( jsonData ) { menuGenerator . addUserItem ( key , authService , label , jsonData ) ; } , function ( errorData ) { menuGenerator . addUserItem ( key , authService , label ) ; } ) ; } , false ) ; } ) ; } ) ; } } ) ; }
Adds the user-related commands to the toolbar

@name orion.globalCommands#generateUserInfo
@function
Adds the user - related commands to the toolbar