Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Commit

Permalink
--
Browse files Browse the repository at this point in the history
--
  • Loading branch information
GaneshKandu committed Aug 6, 2016
1 parent ea9074b commit 9bca112
Show file tree
Hide file tree
Showing 72 changed files with 52,616 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ install.php [QSA,L]
</IfModule>
1 change: 1 addition & 0 deletions apps/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deny from all
36 changes: 36 additions & 0 deletions apps/dashboard.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/*
///////////////////////////////////////////////////
Palatte is a PHP Based Site Builder
Developed By : Ganesh Kandu
Contact Mail : [email protected]
///////////////////////////////////////////////////
*/

class dashboard extends ctrl{

function index($data){
$data['tpl'] = "template";
$data['title'] = "Palette";
$data['content'] = 'dashboard';
return $data;
}

function about($data){
$data['tpl'] = "template";
$data['title'] = "Palette | About";
$data['content'] = 'about';
return $data;
}

function profile($data){
$data['tpl'] = "template";
$data['title'] = "Palette | profile";
$data['content'] = 'profile';
return $data;
}

}

?>
19 changes: 19 additions & 0 deletions apps/editor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/*
///////////////////////////////////////////////////
Palatte is a PHP Based Site Builder
Developed By : Ganesh Kandu
Contact Mail : [email protected]
///////////////////////////////////////////////////
*/

class editor extends ctrl{

function index($data){
$data['tpl'] = "editor";
$data['title'] = "Site Editor";
return $data;
}

}
12 changes: 12 additions & 0 deletions apps/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Forbidden</title>
</head>
<body>
<h1>Forbidden</h1>
<p>You don't have permission to direct access on this server.</p>
<hr>
</body>
</html>
42 changes: 42 additions & 0 deletions apps/login.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

/*
///////////////////////////////////////////////////
Palatte is a PHP Based Site Builder
Developed By : Ganesh Kandu
Contact Mail : [email protected]
///////////////////////////////////////////////////
*/

class login{

function index($data){
$data['tpl'] = "login";
$data['title'] = "Palette Login";
return $data;
}

function getlogin($data){
$login = new user();
$session = new session();
if(isset($_POST['user_login'])){
$user = $_POST['user_login'];
if(isset($_POST['user_password'])){
$pass = $_POST['user_password'];
}
else{
return false;
}
}
else{
return false;
}
if($login->isValidUser($user,$pass)){
$user = $login->getUserDetail();
$session->setSession($user);
}
}

}

?>
20 changes: 20 additions & 0 deletions apps/logout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/*
///////////////////////////////////////////////////
Palatte is a PHP Based Site Builder
Developed By : Ganesh Kandu
Contact Mail : [email protected]
///////////////////////////////////////////////////
*/

class logout extends ctrl{

function index($data){
$data['tpl'] = "login";
$data['title'] = "Palette";
session_destroy();
return $data;
}

}
22 changes: 22 additions & 0 deletions apps/notfound.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

/*
///////////////////////////////////////////////////
Palatte is a PHP Based Site Builder
Developed By : Ganesh Kandu
Contact Mail : [email protected]
///////////////////////////////////////////////////
*/

class notfound extends ctrl{

function index($data){
$data['tpl'] = "template";
$data['title'] = "Palette";
$data['content'] = 'notfound';
return $data;
}

}

?>
103 changes: 103 additions & 0 deletions apps/projects.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?php

/*
///////////////////////////////////////////////////
Palatte is a PHP Based Site Builder
Developed By : Ganesh Kandu
Contact Mail : [email protected]
///////////////////////////////////////////////////
*/

class projects extends ctrl{

function newproject($data){
$data['tpl'] = "template";
$data['title'] = "Palette | New Project";
$data['content'] = 'newproject';
return $data;
}

function createproject($data){
if(isset($_POST['newproject'])){
if($_POST['newproject'] == ""){
return true;
}
make_project($_POST['newproject']);
}
}

function createfile($data){
if(isset($_POST['file'])){
if($_POST['file'] == ""){
return true;
}
$file = trim($_POST['file']);
$index = fopen(PATH.DS.'template'.DS.'default.txt', "r");
$indexcont = "";
while(!feof($index)) {
$indexcont .= fgets($index);
}
$f = explode('/',$file);
$ds = "";
for($i = 0;$i < (count($f)-1);$i++ ){
$ds .= $f[$i].DS;
mkdir($_POST['directory'].$ds);
}
$default = fopen($_POST['directory'].$file.'.html', "w");
fwrite($default, $indexcont);
fclose($default);
}
return $data;
}

function files($data){
$data['tpl'] = "template";
$data['title'] = "Palette | ".$data['project']['project'];
$data['content'] = 'files';
return $data;
}

function remove($data){
if(isset($_POST['project'])){
$proj = $_POST['project'];
}else{
echo "fail";
return false;
}
delete_project(PATH.DS.'sites'.DS.$proj);
return $data;
}

function save(){
$path = '';
if(isset($_POST['project'])){
$prosave = unserialize(base64_decode(trim($_POST['project'])));
}
if(!isset($prosave['name'])){
echo "unsuccess";
return false;
}
if(isset($prosave['file'])){
if(strlen($prosave['file']) == 0){
echo "unsuccess";
return false;
}
}
if (!is_dir (PATH.DS.'sites'.DS.$prosave['name'])){
mkdir(PATH.DS.'sites'.DS.$prosave['name'], 0770);
}
$path .= PATH.DS.'sites'.DS.$prosave['name'];
foreach($prosave['dirs'] as $dir){
if (!is_dir ($path.DS.$dir)){
mkdir($path.DS.$dir, 0770);
}
$path .= DS.$dir;
}
$html = $_POST['html'];
$html = html_page($html);
$save = fopen($path.DS.$prosave['file'], "w");
fwrite($save, $html);
fclose($save);
}
}
?>
25 changes: 25 additions & 0 deletions apps/upload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

class upload extends ctrl{

function index($data){
if(isset($_POST['path'])){
$path = $_POST['path'];
}
if(!isset($path)){
$path = PATH.'sites'.DS.'images'.DS;
}
if (!empty($_FILES)) {
$tempFile = $_FILES['file']['tmp_name'];
$targetPath = $path;
if(!is_dir($targetPath)){
mkdir($targetPath);
}
$targetFile = $targetPath. $_FILES['file']['name'];
move_uploaded_file($tempFile,$targetFile);
}
return $data;
}

}
?>
1 change: 1 addition & 0 deletions config/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deny from all
22 changes: 22 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

/*
///////////////////////////////////////////////////
Palatte is a PHP Based Site Builder
Developed By : Ganesh Kandu
Contact Mail : [email protected]
///////////////////////////////////////////////////
*/

define('DS', DIRECTORY_SEPARATOR);
/* CAN CHANGE USED IN SESSION */
define('SECRET','{SECRET}');
/* URL */
define('URL','http://localhost/Palette');
define('PATH', getcwd());
$admin = array(
'admin'=> '{PASSWORD}'
);
define('ADMIN',serialize($admin));

?>
12 changes: 12 additions & 0 deletions config/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Forbidden</title>
</head>
<body>
<h1>Forbidden</h1>
<p>You don't have permission to direct access on this server.</p>
<hr>
</body>
</html>
21 changes: 21 additions & 0 deletions css/METRO-LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2012-2016 Sergey Pimenov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading

0 comments on commit 9bca112

Please sign in to comment.