forked from tobychui/arozos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ fixDesktop filename script for window + Added more icon and images + Change to USB mount script + Change in shutdown GUI + more
- Loading branch information
Showing
23 changed files
with
1,488 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
/* | ||
Desktop filename decode error auto fixing script | ||
*/ | ||
function gen_uuid() { | ||
return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', | ||
// 32 bits for "time_low" | ||
mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), | ||
|
||
// 16 bits for "time_mid" | ||
mt_rand( 0, 0xffff ), | ||
|
||
// 16 bits for "time_hi_and_version", | ||
// four most significant bits holds version number 4 | ||
mt_rand( 0, 0x0fff ) | 0x4000, | ||
|
||
// 16 bits, 8 bits for "clk_seq_hi_res", | ||
// 8 bits for "clk_seq_low", | ||
// two most significant bits holds zero and one for variant DCE1.1 | ||
mt_rand( 0, 0x3fff ) | 0x8000, | ||
|
||
// 48 bits for "node" | ||
mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) | ||
); | ||
} | ||
|
||
include_once("../auth.php"); | ||
include_once("../SystemAOB/functions/personalization/configIO.php"); | ||
$username = $_SESSION['login']; | ||
$desktopFolder = "files/" . $username . "/"; | ||
if (file_exists($desktopFolder)){ | ||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { | ||
//Window Host | ||
//There might be problems when translating UTF-8 encoded filename into local encoding filenames. This might lead to load fail of the desktop icons. | ||
$desktopFiles = glob($desktopFolder . "*"); | ||
$configs = getConfig("encoding",true); | ||
$counter = 0; | ||
foreach ($desktopFiles as $file){ | ||
//Find the file that do not fits the current local encoding environment set by the system setting | ||
$conFilename = mb_convert_encoding($file, "UTF-8",$configs["forceEncodingType"][3]); | ||
if ($conFilename != $file){ | ||
echo $conFilename; | ||
if (!file_exists($desktopFolder. "recovery/")){ | ||
mkdir($desktopFolder . "recovery/"); | ||
} | ||
rename($file, $desktopFolder . "recovery/" . gen_uuid() . ".zip"); | ||
$counter++; | ||
} | ||
} | ||
if ($counter > 0){ | ||
echo "DONE"; | ||
}else{ | ||
echo "ERROR. Unable to fix the issue."; | ||
} | ||
|
||
}else{ | ||
//Linux | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
file outline,File & Storage | ||
fsearch,File Search,SystemAOB/functions/system_statistic/searchFile.php | ||
fshortcut,Explorer Shortcuts,SystemAOB/functions/file_system/fileShortcutUI.php | ||
diskmg,Disk Manager,SystemAOB/system/diskmg/index.php | ||
usbdev,USB Mounting,SystemAOB/functions/usbMount.php | ||
fshortcut,Explorer Shortcuts,SystemAOB/functions/file_system/fileShortcutUI.php | ||
smbconf,Samba Config,SystemAOB/functions/samba_config/index.php |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
AOB-DEVB_v6-9-2019 | ||
AOB-DEVB_v19-9-2019 |
1 change: 1 addition & 0 deletions
1
src/SystemAOB/functions/personalization/sysconf/fsaccess.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"syspaths":["System Paths","Allowed system paths and mount points. Seperate each path with ;","html","\/media;\/var\/www"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Generic USB Hub,Standard Enhanced PCI to USB Host Controller,Realtek RTL8192CU Wireless LAN 802.11n USB 2.0 Network Adapter,Generic USB Hub,Standard Enhanced PCI to USB Host Controller,Intel(R) USB 3.0 可延伸主機控制器,USB Composite Device,USB Root Hub,USB Root Hub,Intel(R) USB 3.0 根集線器, | ||
Realtek RTL8192CU Wireless LAN 802.11n USB 2.0 Network Adapter,Standard Enhanced PCI to USB Host Controller,Generic USB Hub,Standard Enhanced PCI to USB Host Controller,USB Composite Device,Intel(R) USB 3.0 可延伸主機控制器,USB Root Hub,USB Root Hub,Intel(R) USB 3.0 根集線器,Generic USB Hub, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
$supportedFormats = ["ntfs","vfat"]; | ||
$allowedDirectories = ["/media", "/var/www"]; | ||
if (file_exists("../../functions/personalization/sysconf/fsaccess.config")){ | ||
$allowedDirectories = []; | ||
$settings = json_decode(file_get_contents("../../functions/personalization/sysconf/fsaccess.config"),true); | ||
$paths = $settings["syspaths"][3]; | ||
$paths = explode(";",$paths); | ||
foreach ($paths as $path){ | ||
array_push($allowedDirectories,$path); | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
$partition = json_decode(shell_exec("lsblk -b --json")); | ||
$format = json_decode(shell_exec("lsblk -f -b --json")); | ||
$freeSpace =shell_exec("df"); | ||
while(strpos($freeSpace," ") !== false){ | ||
$freeSpace = str_replace(" "," ",$freeSpace); | ||
} | ||
$freeSpace = explode("\n",$freeSpace); | ||
$freeSpaceParsed = []; | ||
foreach ($freeSpace as $part){ | ||
$part = explode(" ",$part); | ||
array_push($freeSpaceParsed,$part); | ||
} | ||
//Throw away the table header | ||
array_shift($freeSpaceParsed); | ||
header('Content-Type: application/json'); | ||
echo json_encode([$partition,$format,$freeSpaceParsed]); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
//This php requires DiskmgWin.exe to work. | ||
//The three numbers following the disk info is Available space to current user, Total available space, Disk total space in bytes. | ||
include_once("../../../auth.php"); | ||
if (isset($_GET['partition'])){ | ||
$output = shell_exec("DiskmgWin.exe -d"); | ||
}else{ | ||
$output = shell_exec("DiskmgWin.exe"); | ||
} | ||
$tmp = explode(";",trim($output)); | ||
$emptyCheck = array_pop($tmp); | ||
if (trim($emptyCheck) !== ""){ | ||
//Check if the last item is empty. If it is not, push it back into the queue. | ||
array_push($tmp,$emptyCheck); | ||
} | ||
$diskInfo = []; | ||
foreach ($tmp as $disk){ | ||
array_push($diskInfo,explode(",",$disk)); | ||
} | ||
|
||
header('Content-Type: application/json'); | ||
echo json_encode($diskInfo); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
include_once("../auth.php"); | ||
include_once("definition.php"); | ||
|
||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { | ||
die("ERROR. Window is currently not supported."); | ||
}else{ | ||
//Linux environment | ||
if (isset($_GET['dev']) && isset($_GET['format'])){ | ||
$dev = $_GET['dev']; | ||
$format = $_GET['format']; | ||
//Check if dev id correct | ||
preg_match('/sd[a-z][1-9]/', $dev, $result); | ||
if (count($result) == 0){ | ||
die("ERROR. Invalid device ID. " . $dev . " given."); | ||
} | ||
|
||
//Check if dev exists | ||
if (!file_exists("/dev/" . $dev)){ | ||
die("ERROR. Device not exists."); | ||
} | ||
|
||
//Check if format is supported | ||
if (!in_array($format,$supportedFormats)){ | ||
die("ERROR. Not supported format."); | ||
} | ||
|
||
//Check if the dev is mounted. Unmount it if nessary. | ||
$out = shell_exec("lsblk -f -b --json | grep " . $dev); | ||
if (strlen(trim($out)) == 0){ | ||
//Something strange happended | ||
die("ERROR. Unknown error has occured. lsblk return no result."); | ||
} | ||
$out = json_decode(trim($out),true); | ||
if ($out["mountpoint"] !== null){ | ||
//Unmount the dev if it is mounted | ||
shell_exec("sudo umount " . $out["mountpoint"]); | ||
} | ||
|
||
//Unmount once more on dev ID just for safty | ||
shell_exec("sudo umount /dev/" . $dev); | ||
|
||
//Drive ready to be formatted. | ||
if ($format == "ntfs"){ | ||
shell_exec("sudo mkfs.ntfs -f /dev/" . $dev); | ||
}else if ($format == "vfat"){ | ||
shell_exec("sudo mkfs.vfat /dev/" . $dev); | ||
} | ||
echo "DONE"; | ||
}else{ | ||
die("ERROR. Called with invalid paramters."); | ||
} | ||
} | ||
?> |
Oops, something went wrong.