function convertDirectory($path, $io_in, $io_out) { if (is_dir($path)) { $gallery = $io_in->getGallery($path); echo "<ul><li>Checking {$path}<br />\n"; if ($gallery) { if ($gallery->summary != "" && empty($_REQUEST["convertOverwrite"])) { echo "Did NOT overwrite non-empty summary in {$path}<br />\n"; } else { if ($_REQUEST["convertType"] != 'none') { $gallery->summary = $gallery->desc; } if ($_REQUEST["convertType"] == 'move') { $gallery->desc = ""; } } $gallery = setPerms($gallery); for ($i = 0; $i < count($gallery->images); $i++) { $gallery->images[$i] = setPerms($gallery->images[$i]); } if ($io_out->putGallery($gallery)) { echo "Successfully converted {$path}<br />\n"; } else { echo "Problem saving data file for {$path}<br />\n"; } } else { echo "Skipping {$path}<br />\n"; } $d = dir($path); while (($file = $d->read()) !== false) { if ($file == '.' || $file == '..') { continue; } $path = $d->path . "/" . $file; if (is_dir($path)) { convertDirectory($path); } } echo "</li></ul>\n"; } }
* @copyright 2014 nZEDb */ require_once realpath(dirname(__FILE__) . '/../www/config.php'); require_once nZEDb_LIB . 'utility' . DS . 'MoveFileTree.php'; use nzedb\db\Settings; use nzedb\utility; $dirs = array(['basemv' => false, 'source' => nZEDb_MISC . 'testing/DB_scripts', 'target' => nZEDb_MISC . 'testing/DB'], ['basemv' => false, 'source' => nZEDb_MISC . 'testing/Dev_testing/Subject_testing', 'target' => nZEDb_MISC . 'testing/Developers/Subject'], ['basemv' => false, 'source' => nZEDb_MISC . 'testing/Dev_testing', 'target' => nZEDb_MISC . 'testing/Developers'], ['basemv' => false, 'source' => nZEDb_MISC . 'testing/PostProc_testing', 'target' => nZEDb_MISC . 'testing/PostProc'], ['basemv' => false, 'source' => nZEDb_MISC . 'testing/Regex_testing', 'target' => nZEDb_MISC . 'testing/Regex'], ['basemv' => false, 'source' => nZEDb_MISC . 'testing/Release_scripts', 'target' => nZEDb_MISC . 'testing/Release'], ['basemv' => false, 'source' => nZEDb_MISC . 'update_scripts/nix_scripts/tmux/powerline/themes', 'target' => nZEDb_MISC . 'update/nix/tmux/powerline/themes'], ['basemv' => false, 'source' => nZEDb_MISC . 'update_scripts/nix_scripts/tmux/powerline', 'target' => nZEDb_MISC . 'update/nix/tmux/powerline'], ['basemv' => false, 'source' => nZEDb_MISC . 'update_scripts/nix_scripts/screen/sequential', 'target' => nZEDb_MISC . 'update/nix/screen/sequential'], ['basemv' => false, 'source' => nZEDb_MISC . 'update_scripts/nix_scripts/tmux/', 'target' => nZEDb_MISC . 'update/nix/tmux'], ['basemv' => false, 'source' => nZEDb_MISC . 'update_scripts/nix_scripts', 'target' => nZEDb_MISC . 'update/nix'], ['basemv' => false, 'source' => nZEDb_MISC . 'update_scripts/python_scripts/lib', 'target' => nZEDb_MISC . 'update/python/lib'], ['basemv' => false, 'source' => nZEDb_MISC . 'update_scripts/python_scripts', 'target' => nZEDb_MISC . 'update/python'], ['basemv' => false, 'source' => nZEDb_MISC . 'update_scripts/win_scripts', 'target' => nZEDb_MISC . 'update/win'], ['basemv' => false, 'source' => nZEDb_MISC . 'update_scripts', 'target' => nZEDb_MISC . 'update']); foreach ($dirs as $path) { $source = $path['source']; $target = $path['target']; $basemv = isset($path['basemv']) ? $path['basemv'] : true; if (file_exists($source)) { $mover = new \nzedb\utility\MoveFileTree($source, $target, $basemv); if (!$mover->isWIndows()) { setPerms($target); setPerms($source); } echo "Moving files...\n"; $mover->move('*'); echo "Checking directories are empty before deleting them.\n"; $mover->clearEmpty(); } } $pdo = new Settings(); if ($dirs['nzb']['source'] == $pdo->getSetting('nzbpath')) { // Update the nzbpath setting if it is the one in use. $pdo->queryDirect(sprintf('UPDATE settings SET value = %s WHERE setting = %s LIMIT 1', $dirs['nzb']['target'], 'nzbpath')); } //////////////////////////////////////////////////////////////////////////////// function setPerms($path) {
function createChannel($tsAdminF, $array, $perms) { //Create + Record the created channel's CID $result = $tsAdminF->channelCreate($array); //If channel creation succeeds continue if ($result['success'] === TRUE) { echo 'Channel: ' . $array['channel_name'] . ' - successfully created'; setPerms($tsAdminF, $result, $perms); //If channel creation fails echo error } else { echo 'Function Error: Channel creation failure'; } return $result; }
function createSpacer($tsAdminF) { global $successResponse; global $errorResponse; $n = rand(0, 9999); $Fchannel_deafults = array("channel_flag_permanent" => 1, "channel_name" => '[*cspacer' . $n . ']_', "channel_topic" => 'Spacer', "channel_max_users" => 0, "channel_flag_maxclients_unlimited" => 2, "channel_flag_maxfamilyclients_unlimited" => 2, "channel_codec" => 1, "channel_codec_quality" => 1); $Fpermissions_deafult = array("i_channel_needed_delete_power" => '75', "i_channel_needed_permission_modify_power" => '70'); //Create + Record the created channel's CID $result = $tsAdminF->channelCreate($Fchannel_deafults); //If channel creation succeeds continue if ($result['success'] === TRUE) { array_push($successResponse, array('status' => 'success', 'message' => 'Channel spacer successfully created')); setPerms($tsAdminF, $result, $Fpermissions_deafult); //If channel creation fails echo error } else { array_push($errorResponse, array('status' => 'error', 'message' => 'Function Error: Spacer creation failure')); } return $result; }