Cyber Anakins Lightsaber - A Minishell-based backdoor

Current Path : /home/bjb2293782/xn--80abaeoqbbrbgf8aea5a2a2z.xn--p1ai/docs/
Upload File :
Current File : /home/bjb2293782/xn--80abaeoqbbrbgf8aea5a2a2z.xn--p1ai/docs/eventeditor.js

function openEventDialog(json, reload)
{
	var dlg = openDialogBoxWithButtons("Правка события "+json.id, 800, 500);
	var tabControl = new TabControl(dlg.innerElement);

	var page,grid;

	page = tabControl.addTab('Основные');
	grid = createPropertyGrid(page);

	var titleEdit = createEditProperty(grid, "Заголовок:", "100%", json.title);
	var dateEdit = createDateTimeProperty(grid, "Дата и время:", json.date);
	var durationEdit = createEditProperty(grid, "Продолжительность (мин):", 80, json.duration);
	durationEdit.editor.type="number";
	durationEdit.editor.min = 1;
	durationEdit.editor.max = 1000000;
	var showDateEdit = createCheckBoxProperty(grid, "Показать дату и время", json.showDate);
	var impotantEditor = createCheckBoxProperty(grid, "Важное событие", json.impotant);
	
	var descEdit = createMemoProperty(grid, "Описание:", 6, json.desc);
	

	var s = filials[0].text;
	filials[0].text='Вне библиотеки';
	var filialEdit = createComboBoxProperty(grid, "Место проведения (филиал):", filials, json.filial);
	filials[0].text=s;

	var placeEdit = createEditProperty(grid, "Адрес (если вне библиотеки):", "100%", json.place);
	var categoryEdit = createEditProperty(grid, "Возврастная категория (-1 - нет):", 80, json.category);
	categoryEdit.type="number";
	categoryEdit.editor.parentNode.appendChild(document.createElement('SPAN')).innerHTML = "+";

	var peopleEdit = createEditProperty(grid, "Ожидаемое число человек:", 80, json.people);
	peopleEdit.type="number";

	var priceEditor = createEditProperty(grid, "Цена входа:", 80, json.price);
	priceEditor.editor.parentNode.appendChild(document.createElement('SPAN')).innerHTML = "руб.";
	priceEditor.type="number";
	priceEditor.minValue = 0.0;
	priceEditor.maxValue = 100000.0;
	priceEditor.step = 10.0;

	


	page = tabControl.addTab('Афиша');
	createImageProperty(page, 320,320, json.poster && json.poster!='' ? "events/"+json.poster : '',
		function(formData, onOK)
		{
			formData.append('action','events:setposter');
			formData.append('id',json.id);

			sendXHR('api.php', formData,
				function(response)
				{
					onOK(response);
				},
				function(error)
				{
					errorBox(error);
				});	

		},
		function(fileName, onOK)
		{
		 	sendXHR("api.php","action=events:delposter&id="+json.id,
		 		function(response)
		 		{
		 			onOK();
		 		},
		 		function(error)
		 		{
		 			errorBox(error);
		 		});	
		});


	page = tabControl.addTab("Виджеты");
	page.innerHTML = 'Вставьте сюда текст виджета:<br>';
	var scriptEditor = page.appendChild(document.createElement('TEXTAREA'));
	scriptEditor.value = json.scripts ? json.scripts : '';
	scriptEditor.style.width="100%";
	scriptEditor.rows=10;


	page = tabControl.addTab("Информация");
	grid = createPropertyGrid(page);
	createLinkProperty(grid, "Опубликовал:", json.author, json.authorName, editAdmin);
	createStaticProperty(grid, "Когда:", json.publicDate);
	

	var btn = dlg.buttonPanel.appendChild(createInput('button'));
	btn.value = "OK";
	btn.onclick=function()
		{
			var post = "action=events:set";
			post+='&id='+json.id;
			post+='&title='+encodeURIComponent(titleEdit.getValue());
			post+='&date='+encodeURIComponent(dateEdit.getValue());
			post+='&desc='+encodeURIComponent(descEdit.getValue());
			post+='&filial='+filialEdit.getValue();
			post+='&showDate='+(showDateEdit.getValue() ? 1 : 0);
			post+='&impotant='+(impotantEditor.getValue() ? 1 : 0);
			post+='&place='+encodeURIComponent(placeEdit.getValue());
			post+='&category='+encodeURIComponent(categoryEdit.getValue());
			post+='&people='+encodeURIComponent(peopleEdit.getValue());
			post+='&duration='+encodeURIComponent(durationEdit.getValue());
			post+='&scripts='+encodeURIComponent(scriptEditor.value);
			post+='&price='+encodeURIComponent(priceEditor.getValue());

			var btn = this;
			btn.disabled=true;

			sendXHR('api.php',post,
				function(response)
				{
					dlg.close();
					location.reload();
				},
				function(error)
				{
					btn.disabled=false;
					errorBox(error);
				});	
		};
	
	btn = dlg.buttonPanel.appendChild(createInput('button'));
	btn.value="Удалить";
	btn.onclick = function()
		{
			yesNoDialog("Удалить данное событие?","Удаление события",
				function()
				{
				    sendXHR("api.php","action=events:del&id="+json.id,
				    	function()
				    	{
				    		dlg.close();
				    		location.reload();
				    	},
				    	function(error)
				    	{
				    		errorBox(error);
				    	});	
				});
		};

	btn = dlg.buttonPanel.appendChild(createInput('button'));
	btn.value="Закрыть";
	btn.onclick = function()
		{
			dlg.close();
			if (reload) location.reload();
		};

	dlg.alignInScreenCenter();
}



function editEvent(id)
{
	sendXHR('api.php','action=events:get&id='+id,
		function(response)
		{
			openEventDialog(JSON.parse(response));
		},
		function(error)
		{
			errorBox(error);
		});	
}

function newEvent(filial)
{
	if (!filial) filial = adminFilial;
	sendXHR('api.php','action=events:new&filial='+filial,
		function(response)
		{
			openEventDialog(JSON.parse(response), true);
		},
		function(error)
		{
			errorBox(error);
		});
}

function delEvent(id)
{
	yesNoDialog("Удалить данное событие?","Удаление события",
				function()
				{
				    sendXHR("api.php","action=events:del&id="+id,
				    	function()
				    	{
				    		location.reload();
				    	},
				    	function(error)
				    	{
				    		errorBox(error);
				    	});	
				});
	
}

May the force be with you, always.