Fixed database initialization script so that it still works when run multiple times. Previously the StorageRoot would be created again for each installation. Added more verbose output about the database initialization. Added checks for is_null() on the return value for StoredFile::Recall*() functions. Do not create the "public" virtual subfolder when creating a new user. Create the root user in the same way that normal users are created.
This commit is contained in:
parent
5c1a858287
commit
2da8161fb7
|
@ -326,8 +326,8 @@ class M2tree {
|
||||||
{
|
{
|
||||||
global $CC_CONFIG;
|
global $CC_CONFIG;
|
||||||
global $CC_DBC;
|
global $CC_DBC;
|
||||||
if ( ($name == '') && is_null($parId)) {
|
if ($name == '') {
|
||||||
$name = $CC_CONFIG['RootNode'];
|
return null;
|
||||||
}
|
}
|
||||||
$escapedName = pg_escape_string($name);
|
$escapedName = pg_escape_string($name);
|
||||||
$parcond = (is_null($parId) ? "parid is null" :
|
$parcond = (is_null($parId) ? "parid is null" :
|
||||||
|
|
|
@ -27,7 +27,7 @@ class Subjects {
|
||||||
/* ======================================================= public methods */
|
/* ======================================================= public methods */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add new subject
|
* Add new subject (a.k.a. "user")
|
||||||
*
|
*
|
||||||
* @param string $p_login
|
* @param string $p_login
|
||||||
* @param string $p_pass
|
* @param string $p_pass
|
||||||
|
@ -359,6 +359,9 @@ class Subjects {
|
||||||
public static function IsGroup($gid)
|
public static function IsGroup($gid)
|
||||||
{
|
{
|
||||||
global $CC_CONFIG, $CC_DBC;
|
global $CC_CONFIG, $CC_DBC;
|
||||||
|
if (empty($gid)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
$sql = "SELECT type FROM ".$CC_CONFIG['subjTable']
|
$sql = "SELECT type FROM ".$CC_CONFIG['subjTable']
|
||||||
." WHERE id='$gid'";
|
." WHERE id='$gid'";
|
||||||
$r = $CC_DBC->getOne($sql);
|
$r = $CC_DBC->getOne($sql);
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
header("Content-type: text/html; charset=utf-8");
|
header("Content-type: text/html; charset=utf-8");
|
||||||
include 'auth.inc.php';
|
include('auth.inc.php');
|
||||||
|
|
||||||
require_once dirname(__FILE__)."/includes/camp_html.php";
|
require_once(dirname(__FILE__)."/includes/camp_html.php");
|
||||||
require_once dirname(__FILE__)."/includes/Input.php";
|
require_once(dirname(__FILE__)."/includes/Input.php");
|
||||||
require_once 'Localizer.php';
|
require_once('Localizer.php');
|
||||||
|
|
||||||
global $g_translationStrings;
|
global $g_translationStrings;
|
||||||
global $g_localizerConfig;
|
global $g_localizerConfig;
|
||||||
|
@ -28,60 +28,60 @@ if (isset($_REQUEST['TOL_Language'])){
|
||||||
//echo "Action: $action<br>";
|
//echo "Action: $action<br>";
|
||||||
|
|
||||||
if ($g_localizerConfig['MAINTENANCE']) {
|
if ($g_localizerConfig['MAINTENANCE']) {
|
||||||
include 'maintenance.php';
|
include 'maintenance.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'translate':
|
case 'translate':
|
||||||
require_once("translate.php");
|
require_once("translate.php");
|
||||||
translationForm($_REQUEST);
|
translationForm($_REQUEST);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'save_translation':
|
case 'save_translation':
|
||||||
$targetLanguageId = Input::Get('localizer_target_language');
|
$targetLanguageId = Input::Get('localizer_target_language');
|
||||||
$data = Input::Get('data', 'array');
|
$data = Input::Get('data', 'array');
|
||||||
Localizer::ModifyStrings($prefix, $targetLanguageId, $data);
|
Localizer::ModifyStrings($prefix, $targetLanguageId, $data);
|
||||||
// Localizer strings are changed -> reload files
|
// Localizer strings are changed -> reload files
|
||||||
Localizer::LoadLanguageFiles('globals', $langCode);
|
Localizer::LoadLanguageFiles('globals', $langCode);
|
||||||
Localizer::LoadLanguageFiles('localizer', $langCode);
|
Localizer::LoadLanguageFiles('localizer', $langCode);
|
||||||
require_once("translate.php");
|
require_once("translate.php");
|
||||||
translationForm($_REQUEST);
|
translationForm($_REQUEST);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'remove_string':
|
case 'remove_string':
|
||||||
$deleteMe = Input::Get('string', 'string');
|
$deleteMe = Input::Get('string', 'string');
|
||||||
Localizer::RemoveString($prefix, $deleteMe);
|
Localizer::RemoveString($prefix, $deleteMe);
|
||||||
require_once("translate.php");
|
require_once("translate.php");
|
||||||
translationForm($_REQUEST);
|
translationForm($_REQUEST);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'move_string':
|
case 'move_string':
|
||||||
$pos1 = Input::Get('pos1', 'int');
|
$pos1 = Input::Get('pos1', 'int');
|
||||||
$pos2 = Input::Get('pos2', 'int');
|
$pos2 = Input::Get('pos2', 'int');
|
||||||
Localizer::MoveString($prefix, $pos1, $pos2);
|
Localizer::MoveString($prefix, $pos1, $pos2);
|
||||||
require_once("translate.php");
|
require_once("translate.php");
|
||||||
translationForm($_REQUEST);
|
translationForm($_REQUEST);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'add_missing_translation_strings':
|
case 'add_missing_translation_strings':
|
||||||
$missingStrings = Localizer::FindMissingStrings($prefix);
|
$missingStrings = Localizer::FindMissingStrings($prefix);
|
||||||
if (count($missingStrings) > 0) {
|
if (count($missingStrings) > 0) {
|
||||||
Localizer::AddStringAtPosition($prefix, 0, $missingStrings);
|
Localizer::AddStringAtPosition($prefix, 0, $missingStrings);
|
||||||
}
|
}
|
||||||
require_once("translate.php");
|
require_once("translate.php");
|
||||||
translationForm($_REQUEST);
|
translationForm($_REQUEST);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'delete_unused_translation_strings':
|
case 'delete_unused_translation_strings':
|
||||||
$unusedStrings = Localizer::FindUnusedStrings($prefix);
|
$unusedStrings = Localizer::FindUnusedStrings($prefix);
|
||||||
if (count($unusedStrings) > 0) {
|
if (count($unusedStrings) > 0) {
|
||||||
Localizer::RemoveString($prefix, $unusedStrings);
|
Localizer::RemoveString($prefix, $unusedStrings);
|
||||||
}
|
}
|
||||||
require_once("translate.php");
|
require_once("translate.php");
|
||||||
translationForm($_REQUEST);
|
translationForm($_REQUEST);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//case 'add_string':
|
//case 'add_string':
|
||||||
// $pos = Input::Get('pos');
|
// $pos = Input::Get('pos');
|
||||||
// if ($pos == 'begin') {
|
// if ($pos == 'begin') {
|
||||||
|
@ -100,7 +100,7 @@ switch ($action) {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// // skip if all was unset above
|
// // skip if all was unset above
|
||||||
// if (count($_REQUEST['newKey'])) {
|
// if (count($_REQUEST['newKey'])) {
|
||||||
// Localizer::AddStringAtPosition($base, $directory, $pos, $_REQUEST['newKey']);
|
// Localizer::AddStringAtPosition($base, $directory, $pos, $_REQUEST['newKey']);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
|
|
|
@ -97,7 +97,8 @@ class uiPlaylist
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (($userid = $this->Base->gb->playlistIsAvailable($plid, $this->Base->sessid)) !== TRUE) {
|
$userid = $this->Base->gb->playlistIsAvailable($plid, $this->Base->sessid);
|
||||||
|
if ($userid !== TRUE) {
|
||||||
if (UI_WARNING) {
|
if (UI_WARNING) {
|
||||||
$this->Base->_retMsg('Playlist has been locked by "$1".', Subjects::GetSubjName($userid));
|
$this->Base->_retMsg('Playlist has been locked by "$1".', Subjects::GetSubjName($userid));
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,9 @@ class uiSubjects
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PEAR::isError($res = $this->Base->gb->addSubj($request['login'], ($request['passwd']==='' ? NULL : $request['passwd'])))) {
|
$tmpPassword = $request['passwd']==='' ? NULL : $request['passwd'];
|
||||||
|
$res = $this->Base->gb->addSubj($request['login'], $tmpPassword);
|
||||||
|
if (PEAR::isError($res)) {
|
||||||
$this->Base->_retMsg($res->getMessage());
|
$this->Base->_retMsg($res->getMessage());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ class AccessRecur {
|
||||||
}
|
}
|
||||||
$plRes = $r;
|
$plRes = $r;
|
||||||
$r = StoredFile::RecallByGunid($plid);
|
$r = StoredFile::RecallByGunid($plid);
|
||||||
if (PEAR::isError($r)) {
|
if (is_null($r) || PEAR::isError($r)) {
|
||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
$ac = $r;
|
$ac = $r;
|
||||||
|
|
|
@ -302,7 +302,7 @@ class Backup
|
||||||
$gunid = $item['gunid'];
|
$gunid = $item['gunid'];
|
||||||
// get a stored file object of this gunid
|
// get a stored file object of this gunid
|
||||||
$sf = StoredFile::RecallByGunid($gunid);
|
$sf = StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($sf)) {
|
if (is_null($sf) || PEAR::isError($sf)) {
|
||||||
return $sf;
|
return $sf;
|
||||||
}
|
}
|
||||||
$lid = BasicStor::IdFromGunid($gunid);
|
$lid = BasicStor::IdFromGunid($gunid);
|
||||||
|
|
|
@ -129,7 +129,7 @@ class BasicStor {
|
||||||
case "playlist":
|
case "playlist":
|
||||||
case "webstream":
|
case "webstream":
|
||||||
$storedFile = StoredFile::Recall($id);
|
$storedFile = StoredFile::Recall($id);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
// catch nonerror exception:
|
// catch nonerror exception:
|
||||||
//if($storedFile->getCode() != GBERR_FOBJNEX)
|
//if($storedFile->getCode() != GBERR_FOBJNEX)
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
|
@ -233,7 +233,7 @@ class BasicStor {
|
||||||
public function bsReplaceFile($id, $localFilePath, $metadataFilePath, $mdataLoc='file')
|
public function bsReplaceFile($id, $localFilePath, $metadataFilePath, $mdataLoc='file')
|
||||||
{
|
{
|
||||||
$storedFile = StoredFile::Recall($id);
|
$storedFile = StoredFile::Recall($id);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
if (!empty($metadataFilePath) &&
|
if (!empty($metadataFilePath) &&
|
||||||
|
@ -280,7 +280,7 @@ class BasicStor {
|
||||||
case "playlist":
|
case "playlist":
|
||||||
case "webstream":
|
case "webstream":
|
||||||
$storedFile = StoredFile::Recall($id);
|
$storedFile = StoredFile::Recall($id);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
if (is_null($did)) {
|
if (is_null($did)) {
|
||||||
|
@ -514,7 +514,7 @@ class BasicStor {
|
||||||
public function bsOpenDownload($id, $part='media', $parent='0')
|
public function bsOpenDownload($id, $part='media', $parent='0')
|
||||||
{
|
{
|
||||||
$storedFile = StoredFile::Recall($id);
|
$storedFile = StoredFile::Recall($id);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
$gunid = $storedFile->gunid;
|
$gunid = $storedFile->gunid;
|
||||||
|
@ -666,7 +666,7 @@ class BasicStor {
|
||||||
} else {
|
} else {
|
||||||
// Remember the MD5 sum
|
// Remember the MD5 sum
|
||||||
$storedFile = StoredFile::RecallByToken($token);
|
$storedFile = StoredFile::RecallByToken($token);
|
||||||
if (!PEAR::isError($storedFile)) {
|
if (!is_null($storedFile) && !PEAR::isError($storedFile)) {
|
||||||
$storedFile->setMd5($md5sum);
|
$storedFile->setMd5($md5sum);
|
||||||
} else {
|
} else {
|
||||||
# $error = $storedFile;
|
# $error = $storedFile;
|
||||||
|
@ -800,7 +800,7 @@ class BasicStor {
|
||||||
public function bsReplaceMetadata($id, $mdata, $mdataLoc='file')
|
public function bsReplaceMetadata($id, $mdata, $mdataLoc='file')
|
||||||
{
|
{
|
||||||
$storedFile = StoredFile::Recall($id);
|
$storedFile = StoredFile::Recall($id);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
return $storedFile->setMetadata($mdata, $mdataLoc);
|
return $storedFile->setMetadata($mdata, $mdataLoc);
|
||||||
|
@ -817,7 +817,7 @@ class BasicStor {
|
||||||
public function bsGetMetadata($id)
|
public function bsGetMetadata($id)
|
||||||
{
|
{
|
||||||
$storedFile = StoredFile::Recall($id);
|
$storedFile = StoredFile::Recall($id);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
return $storedFile->getMetadata();
|
return $storedFile->getMetadata();
|
||||||
|
@ -902,7 +902,7 @@ class BasicStor {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
$storedFile = StoredFile::Recall($id);
|
$storedFile = StoredFile::Recall($id);
|
||||||
if (PEAR::isError($storedFile) || is_null($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
if (is_null($category)) {
|
if (is_null($category)) {
|
||||||
|
@ -948,7 +948,7 @@ class BasicStor {
|
||||||
$storedFile =& $id;
|
$storedFile =& $id;
|
||||||
} else {
|
} else {
|
||||||
$storedFile = StoredFile::Recall($id);
|
$storedFile = StoredFile::Recall($id);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1011,7 +1011,7 @@ class BasicStor {
|
||||||
$values = array($values);
|
$values = array($values);
|
||||||
}
|
}
|
||||||
$storedFile = StoredFile::Recall($id);
|
$storedFile = StoredFile::Recall($id);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
foreach ($values as $category => $oneValue) {
|
foreach ($values as $category => $oneValue) {
|
||||||
|
@ -1023,7 +1023,7 @@ class BasicStor {
|
||||||
}
|
}
|
||||||
if ($regen) {
|
if ($regen) {
|
||||||
$storedFile = StoredFile::Recall($id);
|
$storedFile = StoredFile::Recall($id);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
$r = $storedFile->md->regenerateXmlFile();
|
$r = $storedFile->md->regenerateXmlFile();
|
||||||
|
@ -1149,7 +1149,7 @@ class BasicStor {
|
||||||
$gunids = array();
|
$gunids = array();
|
||||||
foreach ($plids as $plid) {
|
foreach ($plids as $plid) {
|
||||||
$pl = StoredFile::RecallByGunid($plid);
|
$pl = StoredFile::RecallByGunid($plid);
|
||||||
if (PEAR::isError($pl)) {
|
if (is_null($pl) || PEAR::isError($pl)) {
|
||||||
return $pl;
|
return $pl;
|
||||||
}
|
}
|
||||||
if ($withContent) {
|
if ($withContent) {
|
||||||
|
@ -1177,7 +1177,7 @@ class BasicStor {
|
||||||
}
|
}
|
||||||
foreach ($gunids as $i => $it) {
|
foreach ($gunids as $i => $it) {
|
||||||
$storedFile = StoredFile::RecallByGunid($it['gunid']);
|
$storedFile = StoredFile::RecallByGunid($it['gunid']);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
$MDfname = $storedFile->md->getFileName();
|
$MDfname = $storedFile->md->getFileName();
|
||||||
|
@ -1502,7 +1502,7 @@ class BasicStor {
|
||||||
public function bsAnalyzeFile($id)
|
public function bsAnalyzeFile($id)
|
||||||
{
|
{
|
||||||
$storedFile = StoredFile::Recall($id);
|
$storedFile = StoredFile::Recall($id);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
$ia = $storedFile->analyzeFile();
|
$ia = $storedFile->analyzeFile();
|
||||||
|
@ -1586,6 +1586,9 @@ class BasicStor {
|
||||||
} else {
|
} else {
|
||||||
$storedFile = StoredFile::Recall($id);
|
$storedFile = StoredFile::Recall($id);
|
||||||
}
|
}
|
||||||
|
if (is_null($storedFile)) {
|
||||||
|
return $storedFile;
|
||||||
|
}
|
||||||
if (PEAR::isError($storedFile)) {
|
if (PEAR::isError($storedFile)) {
|
||||||
// catch some exceptions
|
// catch some exceptions
|
||||||
switch ($storedFile->getCode()) {
|
switch ($storedFile->getCode()) {
|
||||||
|
@ -1649,7 +1652,7 @@ class BasicStor {
|
||||||
public function addSubj($login, $pass=NULL, $realname='')
|
public function addSubj($login, $pass=NULL, $realname='')
|
||||||
{
|
{
|
||||||
global $CC_CONFIG;
|
global $CC_CONFIG;
|
||||||
$uid = Subjects::addSubj($login, $pass, $realname);
|
$uid = Subjects::AddSubj($login, $pass, $realname);
|
||||||
if (PEAR::isError($uid)) {
|
if (PEAR::isError($uid)) {
|
||||||
return $uid;
|
return $uid;
|
||||||
}
|
}
|
||||||
|
@ -1671,22 +1674,22 @@ class BasicStor {
|
||||||
if (PEAR::isError($res)) {
|
if (PEAR::isError($res)) {
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
$pfid = BasicStor::bsCreateFolder($fid, 'public');
|
//$pfid = BasicStor::bsCreateFolder($fid, 'public');
|
||||||
if (PEAR::isError($pfid)) {
|
//if (PEAR::isError($pfid)) {
|
||||||
return $pfid;
|
// return $pfid;
|
||||||
}
|
//}
|
||||||
$res = Alib::AddPerm($uid, '_all', $pfid, 'A');
|
//$res = Alib::AddPerm($uid, '_all', $pfid, 'A');
|
||||||
if (PEAR::isError($res)) {
|
//if (PEAR::isError($res)) {
|
||||||
return $res;
|
// return $res;
|
||||||
}
|
//}
|
||||||
$allGrId = Subjects::GetSubjId($CC_CONFIG['AllGr']);
|
//$allGrId = Subjects::GetSubjId($CC_CONFIG['AllGr']);
|
||||||
if (PEAR::isError($allGrId)) {
|
//if (PEAR::isError($allGrId)) {
|
||||||
return $allGrId;
|
// return $allGrId;
|
||||||
}
|
//}
|
||||||
$res = Alib::AddPerm($allGrId, 'read', $pfid, 'A');
|
//$res = Alib::AddPerm($allGrId, 'read', $pfid, 'A');
|
||||||
if (PEAR::isError($res)) {
|
//if (PEAR::isError($res)) {
|
||||||
return $res;
|
// return $res;
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $uid;
|
return $uid;
|
||||||
|
@ -1959,7 +1962,7 @@ class BasicStor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$storedFile = StoredFile::RecallByGunid($p_playlistId);
|
$storedFile = StoredFile::RecallByGunid($p_playlistId);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
$state = $storedFile->getState();
|
$state = $storedFile->getState();
|
||||||
|
@ -1986,7 +1989,7 @@ class BasicStor {
|
||||||
public function isEdited($p_playlistId)
|
public function isEdited($p_playlistId)
|
||||||
{
|
{
|
||||||
$storedFile = StoredFile::RecallByGunid($p_playlistId);
|
$storedFile = StoredFile::RecallByGunid($p_playlistId);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
if (!$storedFile->isEdited($p_playlistId)) {
|
if (!$storedFile->isEdited($p_playlistId)) {
|
||||||
|
@ -2016,7 +2019,7 @@ class BasicStor {
|
||||||
case "playlist":
|
case "playlist":
|
||||||
case "webstream":
|
case "webstream":
|
||||||
$storedFile = StoredFile::Recall($id);
|
$storedFile = StoredFile::Recall($id);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
$ac2 = StoredFile::CopyOf($storedFile, $nid);
|
$ac2 = StoredFile::CopyOf($storedFile, $nid);
|
||||||
|
@ -2043,7 +2046,7 @@ class BasicStor {
|
||||||
case "playlist":
|
case "playlist":
|
||||||
case "webstream":
|
case "webstream":
|
||||||
$storedFile = StoredFile::Recall($id);
|
$storedFile = StoredFile::Recall($id);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
if ($storedFile->isEdited()) {
|
if ($storedFile->isEdited()) {
|
||||||
|
@ -2066,8 +2069,7 @@ class BasicStor {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optionaly remove virtual file with the same name and add new one.<br>
|
* Add a virtual file.
|
||||||
* Redefined from parent class.
|
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
* Database ID of the object.
|
* Database ID of the object.
|
||||||
|
@ -2078,7 +2080,6 @@ class BasicStor {
|
||||||
if (PEAR::isError($exid)) {
|
if (PEAR::isError($exid)) {
|
||||||
return $exid;
|
return $exid;
|
||||||
}
|
}
|
||||||
//if(!is_null($exid)){ BasicStor::RemoveObj($exid); }
|
|
||||||
$name2 = $name;
|
$name2 = $name;
|
||||||
for ( ;
|
for ( ;
|
||||||
$xid = M2tree::GetObjId($name2, $parid),
|
$xid = M2tree::GetObjId($name2, $parid),
|
||||||
|
@ -2333,93 +2334,117 @@ class BasicStor {
|
||||||
{
|
{
|
||||||
global $CC_CONFIG;
|
global $CC_CONFIG;
|
||||||
$this->rootId = M2tree::GetRootNode();
|
$this->rootId = M2tree::GetRootNode();
|
||||||
$this->storId = BasicStor::AddObj('StorageRoot', 'Folder', $this->rootId);
|
|
||||||
$this->wd = $this->storId;
|
|
||||||
|
|
||||||
if (!Subjects::GetSubjId('root')) {
|
// Check if the StorageRoot already exists, if not, create it.
|
||||||
if ($p_verbose) {
|
$storageRootId = M2tree::GetObjId('StorageRoot', $this->rootId);
|
||||||
echo " * Creating user 'root'...";
|
if (is_null($storageRootId)) {
|
||||||
}
|
echo " * Creating 'StorageRoot' node...";
|
||||||
// Create user 'root'.
|
$this->storId = BasicStor::AddObj('StorageRoot', 'Folder', $this->rootId);
|
||||||
$rootUid = Subjects::AddSubj('root', $CC_CONFIG['tmpRootPass']);
|
$this->wd = $this->storId;
|
||||||
$res = Alib::AddPerm($rootUid, '_all', $this->rootId, 'A');
|
|
||||||
if (PEAR::isError($res)) {
|
|
||||||
return $res;
|
|
||||||
}
|
|
||||||
$res = Alib::AddPerm($rootUid, 'subjects', $this->rootId, 'A');
|
|
||||||
if (PEAR::isError($res)) {
|
|
||||||
return $res;
|
|
||||||
}
|
|
||||||
$allid = Subjects::AddSubj($CC_CONFIG['AllGr']);
|
|
||||||
if (PEAR::isError($allid)) {
|
|
||||||
return $allid;
|
|
||||||
}
|
|
||||||
Subjects::AddSubjectToGroup('root', $CC_CONFIG['AllGr']);
|
|
||||||
Alib::AddPerm($allid, 'read', $this->rootId, 'A');
|
|
||||||
$admid = Subjects::AddSubj($CC_CONFIG['AdminsGr']);
|
|
||||||
if (PEAR::isError($admid)) {
|
|
||||||
return $admid;
|
|
||||||
}
|
|
||||||
$r = Subjects::AddSubjectToGroup('root', $CC_CONFIG['AdminsGr']);
|
|
||||||
if (PEAR::isError($r)) {
|
|
||||||
return $r;
|
|
||||||
}
|
|
||||||
$res = Alib::AddPerm($admid, '_all', $this->rootId, 'A');
|
|
||||||
if (PEAR::isError($res)) {
|
|
||||||
return $res;
|
|
||||||
}
|
|
||||||
if ($p_verbose) {
|
|
||||||
echo "done.\n";
|
|
||||||
}
|
|
||||||
} elseif ($p_verbose) {
|
|
||||||
echo " * Skipping: user 'root' already exists.\n";
|
|
||||||
}
|
|
||||||
if ($p_verbose) {
|
|
||||||
echo " * Creating storage root directory...";
|
|
||||||
}
|
|
||||||
$fid = BasicStor::bsCreateFolder($this->storId, 'root');
|
|
||||||
if (PEAR::isError($fid)) {
|
|
||||||
return $fid;
|
|
||||||
}
|
|
||||||
if ($p_verbose) {
|
|
||||||
echo "done.\n";
|
echo "done.\n";
|
||||||
|
} else {
|
||||||
|
echo " * Skipping: StorageRoot already exists.\n";
|
||||||
}
|
}
|
||||||
if ($CC_CONFIG['useTrash']) {
|
|
||||||
if ($p_verbose) {
|
// Create the Admin group
|
||||||
echo " * Creating trashcan...";
|
if (!empty($CC_CONFIG['AdminsGr'])) {
|
||||||
}
|
if (!Subjects::GetSubjId($CC_CONFIG['AdminsGr'])) {
|
||||||
$tfid = BasicStor::bsCreateFolder($this->storId, $CC_CONFIG["TrashName"]);
|
echo " * Creating group '".$CC_CONFIG['AdminsGr']."'...";
|
||||||
if (PEAR::isError($tfid)) {
|
// Add the admin group
|
||||||
return $tfid;
|
$admid = Subjects::AddSubj($CC_CONFIG['AdminsGr']);
|
||||||
}
|
if (PEAR::isError($admid)) {
|
||||||
if ($p_verbose) {
|
return $admid;
|
||||||
echo "done.\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!$CC_CONFIG['isArchive']) {
|
|
||||||
if (!Subjects::GetSubjId('scheduler')) {
|
|
||||||
if ($p_verbose) {
|
|
||||||
echo " * Creating user 'scheduler'...";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add the "all" permission to the "admin" group
|
||||||
|
$res = Alib::AddPerm($admid, '_all', $this->rootId, 'A');
|
||||||
|
if (PEAR::isError($res)) {
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
echo "done.\n";
|
||||||
|
} else {
|
||||||
|
echo " * Skipping: group already exists: '".$CC_CONFIG['AdminsGr']."'\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add the "all" group
|
||||||
|
if (!empty($CC_CONFIG['AllGr'])) {
|
||||||
|
if (!Subjects::GetSubjId($CC_CONFIG['AllGr'])) {
|
||||||
|
echo " * Creating group '".$CC_CONFIG['AllGr']."'...";
|
||||||
|
$allid = Subjects::AddSubj($CC_CONFIG['AllGr']);
|
||||||
|
if (PEAR::isError($allid)) {
|
||||||
|
return $allid;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add the "read" permission to the "all" group.
|
||||||
|
Alib::AddPerm($allid, 'read', $this->rootId, 'A');
|
||||||
|
echo "done.\n";
|
||||||
|
} else {
|
||||||
|
echo " * Skipping: group already exists: '".$CC_CONFIG['AllGr']."'\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add the "Station Preferences" group
|
||||||
|
if (!empty($CC_CONFIG['StationPrefsGr'])) {
|
||||||
|
if (!Subjects::GetSubjId('scheduler')) {
|
||||||
|
echo " * Creating group '".$CC_CONFIG['StationPrefsGr']."'...";
|
||||||
$stPrefGr = Subjects::AddSubj($CC_CONFIG['StationPrefsGr']);
|
$stPrefGr = Subjects::AddSubj($CC_CONFIG['StationPrefsGr']);
|
||||||
if (PEAR::isError($stPrefGr)) {
|
if (PEAR::isError($stPrefGr)) {
|
||||||
return $stPrefGr;
|
return $stPrefGr;
|
||||||
}
|
}
|
||||||
Subjects::AddSubjectToGroup('root', $CC_CONFIG['StationPrefsGr']);
|
Subjects::AddSubjectToGroup('root', $CC_CONFIG['StationPrefsGr']);
|
||||||
// Create the user named 'scheduler'.
|
echo "done.\n";
|
||||||
Subjects::AddSubj('scheduler', $CC_CONFIG['schedulerPass']);
|
} else {
|
||||||
$res = Alib::AddPerm($rootUid, 'read', $this->rootId, 'A');
|
echo " * Skipping: group already exists: '".$CC_CONFIG['StationPrefsGr']."'\n";
|
||||||
if (PEAR::isError($res)) {
|
|
||||||
return $res;
|
|
||||||
}
|
|
||||||
$r = Subjects::AddSubjectToGroup('scheduler', $CC_CONFIG['AllGr']);
|
|
||||||
if ($p_verbose) {
|
|
||||||
echo "done.\n";
|
|
||||||
}
|
|
||||||
} else if ($p_verbose) {
|
|
||||||
echo " * Skipping: user 'scheduler' already exists.\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add the root user if it doesnt exist yet.
|
||||||
|
$rootUid = Subjects::GetSubjId('root');
|
||||||
|
if (!$rootUid) {
|
||||||
|
echo " * Creating user 'root'...";
|
||||||
|
$rootUid = $this->addSubj("root", $CC_CONFIG['tmpRootPass']);
|
||||||
|
if (PEAR::isError($rootUid)) {
|
||||||
|
return $rootUid;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add root user to the admin group
|
||||||
|
$r = Subjects::AddSubjectToGroup('root', $CC_CONFIG['AdminsGr']);
|
||||||
|
if (PEAR::isError($r)) {
|
||||||
|
return $r;
|
||||||
|
}
|
||||||
|
echo "done.\n";
|
||||||
|
} else {
|
||||||
|
echo " * Skipping: user already exists: 'root'\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($CC_CONFIG['TrashName'])) {
|
||||||
|
$trashId = M2tree::GetObjId($CC_CONFIG['TrashName'], $this->storId);
|
||||||
|
if (!$trashId) {
|
||||||
|
echo " * Creating trash can...";
|
||||||
|
$tfid = BasicStor::bsCreateFolder($this->storId, $CC_CONFIG["TrashName"]);
|
||||||
|
if (PEAR::isError($tfid)) {
|
||||||
|
return $tfid;
|
||||||
|
}
|
||||||
|
echo "done.\n";
|
||||||
|
} else {
|
||||||
|
echo " * Skipping: trash can already exists.\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the user named 'scheduler'.
|
||||||
|
if (!Subjects::GetSubjId('scheduler')) {
|
||||||
|
echo " * Creating user 'scheduler'...";
|
||||||
|
Subjects::AddSubj('scheduler', $CC_CONFIG['schedulerPass']);
|
||||||
|
$res = Alib::AddPerm($rootUid, 'read', $this->rootId, 'A');
|
||||||
|
if (PEAR::isError($res)) {
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
$r = Subjects::AddSubjectToGroup('scheduler', $CC_CONFIG['AllGr']);
|
||||||
|
echo "done.\n";
|
||||||
|
} else {
|
||||||
|
echo " * Skipping: user already exists: 'scheduler'\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -346,7 +346,7 @@ class GreenBox extends BasicStor {
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
$storedFile = StoredFile::Recall($id);
|
$storedFile = StoredFile::Recall($id);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
$arr = $storedFile->md->genPhpArray();
|
$arr = $storedFile->md->genPhpArray();
|
||||||
|
@ -596,7 +596,7 @@ class GreenBox extends BasicStor {
|
||||||
{
|
{
|
||||||
$gunid = BasicStor::GunidFromId($id);
|
$gunid = BasicStor::GunidFromId($id);
|
||||||
$pl = StoredFile::Recall($id);
|
$pl = StoredFile::Recall($id);
|
||||||
if (PEAR::isError($pl)) {
|
if (is_null($pl) || PEAR::isError($pl)) {
|
||||||
return $pl;
|
return $pl;
|
||||||
}
|
}
|
||||||
$gunid = $pl->gunid;
|
$gunid = $pl->gunid;
|
||||||
|
@ -643,7 +643,7 @@ class GreenBox extends BasicStor {
|
||||||
return $gunid;
|
return $gunid;
|
||||||
}
|
}
|
||||||
$storedFile = StoredFile::RecallByGunid($gunid);
|
$storedFile = StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
$r = $storedFile->md->regenerateXmlFile();
|
$r = $storedFile->md->regenerateXmlFile();
|
||||||
|
@ -678,9 +678,9 @@ class GreenBox extends BasicStor {
|
||||||
public function addAudioClipToPlaylist($token, $acId, $sessid,
|
public function addAudioClipToPlaylist($token, $acId, $sessid,
|
||||||
$fadeIn=NULL, $fadeOut=NULL, $length=NULL, $pause=NULL)
|
$fadeIn=NULL, $fadeOut=NULL, $length=NULL, $pause=NULL)
|
||||||
{
|
{
|
||||||
require_once"Playlist.php";
|
require_once("Playlist.php");
|
||||||
$pl = StoredFile::RecallByToken($token);
|
$pl = StoredFile::RecallByToken($token);
|
||||||
if (PEAR::isError($pl)) {
|
if (is_null($pl) || PEAR::isError($pl)) {
|
||||||
return $pl;
|
return $pl;
|
||||||
}
|
}
|
||||||
$acGunid = BasicStor::GunidFromId($acId);
|
$acGunid = BasicStor::GunidFromId($acId);
|
||||||
|
@ -721,7 +721,7 @@ class GreenBox extends BasicStor {
|
||||||
{
|
{
|
||||||
require_once("Playlist.php");
|
require_once("Playlist.php");
|
||||||
$pl = StoredFile::RecallByToken($token);
|
$pl = StoredFile::RecallByToken($token);
|
||||||
if (PEAR::isError($pl)) {
|
if (is_null($pl) || PEAR::isError($pl)) {
|
||||||
return $pl;
|
return $pl;
|
||||||
}
|
}
|
||||||
$res = $pl->delAudioClip($plElGunid);
|
$res = $pl->delAudioClip($plElGunid);
|
||||||
|
@ -756,7 +756,7 @@ class GreenBox extends BasicStor {
|
||||||
{
|
{
|
||||||
require_once("Playlist.php");
|
require_once("Playlist.php");
|
||||||
$pl = StoredFile::RecallByToken($token);
|
$pl = StoredFile::RecallByToken($token);
|
||||||
if (PEAR::isError($pl)) {
|
if (is_null($pl) || PEAR::isError($pl)) {
|
||||||
return $pl;
|
return $pl;
|
||||||
}
|
}
|
||||||
$res = $pl->changeFadeInfo($plElGunid, $fadeIn, $fadeOut);
|
$res = $pl->changeFadeInfo($plElGunid, $fadeIn, $fadeOut);
|
||||||
|
@ -792,7 +792,7 @@ class GreenBox extends BasicStor {
|
||||||
{
|
{
|
||||||
require_once("Playlist.php");
|
require_once("Playlist.php");
|
||||||
$pl = StoredFile::RecallByToken($token);
|
$pl = StoredFile::RecallByToken($token);
|
||||||
if (PEAR::isError($pl)) {
|
if (is_null($pl) || PEAR::isError($pl)) {
|
||||||
return $pl;
|
return $pl;
|
||||||
}
|
}
|
||||||
$res = $pl->moveAudioClip($plElGunid, $newPos);
|
$res = $pl->moveAudioClip($plElGunid, $newPos);
|
||||||
|
@ -872,7 +872,7 @@ class GreenBox extends BasicStor {
|
||||||
{
|
{
|
||||||
require_once("Playlist.php");
|
require_once("Playlist.php");
|
||||||
$pl = StoredFile::RecallByGunid($plid);
|
$pl = StoredFile::RecallByGunid($plid);
|
||||||
if (PEAR::isError($pl)) {
|
if (is_null($pl) || PEAR::isError($pl)) {
|
||||||
return $pl;
|
return $pl;
|
||||||
}
|
}
|
||||||
$res = $pl->displayPlaylistClipAtOffset($offset, $distance);
|
$res = $pl->displayPlaylistClipAtOffset($offset, $distance);
|
||||||
|
|
|
@ -132,7 +132,7 @@ class LocStor extends BasicStor {
|
||||||
protected function storeAudioClipClose($sessid, $token)
|
protected function storeAudioClipClose($sessid, $token)
|
||||||
{
|
{
|
||||||
$storedFile =& StoredFile::RecallByToken($token);
|
$storedFile =& StoredFile::RecallByToken($token);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
$arr = $this->bsClosePut($token);
|
$arr = $this->bsClosePut($token);
|
||||||
|
@ -198,7 +198,7 @@ class LocStor extends BasicStor {
|
||||||
return $gunid;
|
return $gunid;
|
||||||
}
|
}
|
||||||
$storedFile =& StoredFile::RecallByGunid($gunid);
|
$storedFile =& StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
$oid = $storedFile->getId();
|
$oid = $storedFile->getId();
|
||||||
|
@ -225,7 +225,7 @@ class LocStor extends BasicStor {
|
||||||
public function accessRawAudioData($sessid, $gunid, $parent='0')
|
public function accessRawAudioData($sessid, $gunid, $parent='0')
|
||||||
{
|
{
|
||||||
$storedFile =& StoredFile::RecallByGunid($gunid);
|
$storedFile =& StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
if (($res = BasicStor::Authorize('read', $storedFile->getId(), $sessid)) !== TRUE) {
|
if (($res = BasicStor::Authorize('read', $storedFile->getId(), $sessid)) !== TRUE) {
|
||||||
|
@ -246,7 +246,7 @@ class LocStor extends BasicStor {
|
||||||
public function releaseRawAudioData($sessid, $token)
|
public function releaseRawAudioData($sessid, $token)
|
||||||
{
|
{
|
||||||
$storedFile =& StoredFile::RecallByToken($token);
|
$storedFile =& StoredFile::RecallByToken($token);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
return $storedFile->releaseRawMediaData($token);
|
return $storedFile->releaseRawMediaData($token);
|
||||||
|
@ -353,7 +353,7 @@ class LocStor extends BasicStor {
|
||||||
protected function getAudioClip($sessid, $gunid)
|
protected function getAudioClip($sessid, $gunid)
|
||||||
{
|
{
|
||||||
$storedFile =& StoredFile::RecallByGunid($gunid);
|
$storedFile =& StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
if (($res = BasicStor::Authorize('read', $storedFile->getId(), $sessid)) !== TRUE) {
|
if (($res = BasicStor::Authorize('read', $storedFile->getId(), $sessid)) !== TRUE) {
|
||||||
|
@ -493,7 +493,7 @@ class LocStor extends BasicStor {
|
||||||
return $ex;
|
return $ex;
|
||||||
}
|
}
|
||||||
$storedFile =& StoredFile::RecallByGunid($gunid);
|
$storedFile =& StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
return $storedFile->exists();
|
return $storedFile->exists();
|
||||||
|
@ -567,7 +567,7 @@ class LocStor extends BasicStor {
|
||||||
protected function updateAudioClipMetadata($sessid, $gunid, $metadata)
|
protected function updateAudioClipMetadata($sessid, $gunid, $metadata)
|
||||||
{
|
{
|
||||||
$storedFile =& StoredFile::RecallByGunid($gunid);
|
$storedFile =& StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
if (($res = BasicStor::Authorize('write', $storedFile->getId(), $sessid)) !== TRUE) {
|
if (($res = BasicStor::Authorize('write', $storedFile->getId(), $sessid)) !== TRUE) {
|
||||||
|
@ -670,7 +670,7 @@ class LocStor extends BasicStor {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$storedFile =& StoredFile::RecallByGunid($playlistId);
|
$storedFile =& StoredFile::RecallByGunid($playlistId);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
$id = $storedFile->getId();
|
$id = $storedFile->getId();
|
||||||
|
@ -709,7 +709,7 @@ class LocStor extends BasicStor {
|
||||||
return $playlistId;
|
return $playlistId;
|
||||||
}
|
}
|
||||||
$storedFile =& StoredFile::RecallByGunid($playlistId);
|
$storedFile =& StoredFile::RecallByGunid($playlistId);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
$res = $storedFile->setMetadata($newPlaylist, 'string', 'playlist');
|
$res = $storedFile->setMetadata($newPlaylist, 'string', 'playlist');
|
||||||
|
@ -741,7 +741,7 @@ class LocStor extends BasicStor {
|
||||||
return $gunid;
|
return $gunid;
|
||||||
}
|
}
|
||||||
$storedFile =& StoredFile::RecallByGunid($gunid);
|
$storedFile =& StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
$id = $storedFile->getId();
|
$id = $storedFile->getId();
|
||||||
|
@ -785,7 +785,7 @@ class LocStor extends BasicStor {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$storedFile =& StoredFile::RecallByGunid($playlistId);
|
$storedFile =& StoredFile::RecallByGunid($playlistId);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
if (($res = BasicStor::Authorize('write', $storedFile->getId(), $sessid)) !== TRUE) {
|
if (($res = BasicStor::Authorize('write', $storedFile->getId(), $sessid)) !== TRUE) {
|
||||||
|
|
|
@ -543,7 +543,7 @@ class Playlist extends StoredFile {
|
||||||
switch ($el['type']) {
|
switch ($el['type']) {
|
||||||
case "playlist":
|
case "playlist":
|
||||||
$pl = StoredFile::RecallByGunid($acGunid);
|
$pl = StoredFile::RecallByGunid($acGunid);
|
||||||
if (PEAR::isError($pl)) {
|
if (is_null($pl) || PEAR::isError($pl)) {
|
||||||
return $pl;
|
return $pl;
|
||||||
}
|
}
|
||||||
if ($dd > 0) {
|
if ($dd > 0) {
|
||||||
|
@ -620,7 +620,7 @@ class Playlist extends StoredFile {
|
||||||
switch ($el['type']) {
|
switch ($el['type']) {
|
||||||
case "playlist":
|
case "playlist":
|
||||||
$pl = StoredFile::RecallByGunid($acGunid);
|
$pl = StoredFile::RecallByGunid($acGunid);
|
||||||
if (PEAR::isError($pl)) {
|
if (is_null($pl) || PEAR::isError($pl)) {
|
||||||
return $pl;
|
return $pl;
|
||||||
}
|
}
|
||||||
$res2 = $pl->export();
|
$res2 = $pl->export();
|
||||||
|
@ -692,7 +692,7 @@ class Playlist extends StoredFile {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
$pl = StoredFile::RecallByGunid($insGunid);
|
$pl = StoredFile::RecallByGunid($insGunid);
|
||||||
if (PEAR::isError($pl)) {
|
if (is_null($pl) || PEAR::isError($pl)) {
|
||||||
return $pl;
|
return $pl;
|
||||||
}
|
}
|
||||||
$arr = $pl->md->genPhpArray();
|
$arr = $pl->md->genPhpArray();
|
||||||
|
@ -866,7 +866,7 @@ class Playlist extends StoredFile {
|
||||||
private function getAudioClipInfo($acId)
|
private function getAudioClipInfo($acId)
|
||||||
{
|
{
|
||||||
$ac = StoredFile::Recall($acId);
|
$ac = StoredFile::Recall($acId);
|
||||||
if (PEAR::isError($ac)) {
|
if (is_null($ac) || PEAR::isError($ac)) {
|
||||||
return $ac;
|
return $ac;
|
||||||
}
|
}
|
||||||
$acGunid = $ac->gunid;
|
$acGunid = $ac->gunid;
|
||||||
|
@ -1390,7 +1390,7 @@ class PlaylistElementExport {
|
||||||
case "playlist":
|
case "playlist":
|
||||||
$gunid = $ac['attrs']['id'];
|
$gunid = $ac['attrs']['id'];
|
||||||
$pl2 = StoredFile::RecallByGunid($gunid);
|
$pl2 = StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($pl2)) {
|
if (is_null($pl2) || PEAR::isError($pl2)) {
|
||||||
return $pl2;
|
return $pl2;
|
||||||
}
|
}
|
||||||
$r = $pl2->outputToSmil(FALSE);
|
$r = $pl2->outputToSmil(FALSE);
|
||||||
|
@ -1463,7 +1463,7 @@ class PlaylistElementExport {
|
||||||
case "playlist":
|
case "playlist":
|
||||||
$gunid = $ac['attrs']['id'];
|
$gunid = $ac['attrs']['id'];
|
||||||
$pl2 = StoredFile::RecallByGunid($gunid);
|
$pl2 = StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($pl2)) {
|
if (is_null($pl2) || PEAR::isError($pl2)) {
|
||||||
return $pl2;
|
return $pl2;
|
||||||
}
|
}
|
||||||
$r = $pl2->outputToM3u(FALSE);
|
$r = $pl2->outputToM3u(FALSE);
|
||||||
|
@ -1507,7 +1507,7 @@ class PlaylistElementExport {
|
||||||
case "playlist":
|
case "playlist":
|
||||||
$gunid = $ac['attrs']['id'];
|
$gunid = $ac['attrs']['id'];
|
||||||
$pl2 = StoredFile::RecallByGunid($gunid);
|
$pl2 = StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($pl2)) {
|
if (is_null($pl2) || PEAR::isError($pl2)) {
|
||||||
return $pl2;
|
return $pl2;
|
||||||
}
|
}
|
||||||
$r = $pl2->outputToRss(FALSE);
|
$r = $pl2->outputToRss(FALSE);
|
||||||
|
@ -1558,7 +1558,7 @@ class PlaylistAudioClipExport
|
||||||
{
|
{
|
||||||
$gunid = $plac['attrs']['id'];
|
$gunid = $plac['attrs']['id'];
|
||||||
$ac = StoredFile::RecallByGunid($gunid);
|
$ac = StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($ac)) {
|
if (is_null($ac) || PEAR::isError($ac)) {
|
||||||
return $ac;
|
return $ac;
|
||||||
}
|
}
|
||||||
$RADext = $ac->getFileExtension();
|
$RADext = $ac->getFileExtension();
|
||||||
|
@ -1578,7 +1578,7 @@ class PlaylistAudioClipExport
|
||||||
{
|
{
|
||||||
$gunid = $plac['attrs']['id'];
|
$gunid = $plac['attrs']['id'];
|
||||||
$ac = StoredFile::RecallByGunid($gunid);
|
$ac = StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($ac)) {
|
if (is_null($ac) || PEAR::isError($ac)) {
|
||||||
return $ac;
|
return $ac;
|
||||||
}
|
}
|
||||||
$RADext = $ac->getFileExtension();
|
$RADext = $ac->getFileExtension();
|
||||||
|
@ -1597,7 +1597,7 @@ class PlaylistAudioClipExport
|
||||||
{
|
{
|
||||||
$gunid = $plac['attrs']['id'];
|
$gunid = $plac['attrs']['id'];
|
||||||
$ac = StoredFile::RecallByGunid($gunid);
|
$ac = StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($ac)) {
|
if (is_null($ac) || PEAR::isError($ac)) {
|
||||||
return $ac;
|
return $ac;
|
||||||
}
|
}
|
||||||
$RADext = $ac->getFileExtension();
|
$RADext = $ac->getFileExtension();
|
||||||
|
|
|
@ -38,7 +38,7 @@ class Renderer
|
||||||
global $CC_CONFIG;
|
global $CC_CONFIG;
|
||||||
// recall playlist:
|
// recall playlist:
|
||||||
$pl = StoredFile::RecallByGunid($plid);
|
$pl = StoredFile::RecallByGunid($plid);
|
||||||
if (PEAR::isError($pl)) {
|
if (is_null($pl) || PEAR::isError($pl)) {
|
||||||
return $pl;
|
return $pl;
|
||||||
}
|
}
|
||||||
// smil export:
|
// smil export:
|
||||||
|
|
|
@ -333,7 +333,7 @@ class Restore {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$ac = StoredFile::RecallByGunid($gunid);
|
$ac = StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($ac)) {
|
if (is_null($ac) || PEAR::isError($ac)) {
|
||||||
return $ac;
|
return $ac;
|
||||||
}
|
}
|
||||||
$res = $ac->setState('ready');
|
$res = $ac->setState('ready');
|
||||||
|
|
|
@ -263,7 +263,7 @@ class SmilPlaylistAudioElement {
|
||||||
//break;
|
//break;
|
||||||
default:
|
default:
|
||||||
$ac = StoredFile::RecallByGunid($gunid);
|
$ac = StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($ac)) {
|
if (is_null($ac) || PEAR::isError($ac)) {
|
||||||
return $ac;
|
return $ac;
|
||||||
}
|
}
|
||||||
$r = $ac->md->getMetadataElement('dcterms:extent');
|
$r = $ac->md->getMetadataElement('dcterms:extent');
|
||||||
|
|
|
@ -295,7 +295,7 @@ class Transport
|
||||||
case "audioclip":
|
case "audioclip":
|
||||||
case "webstream":
|
case "webstream":
|
||||||
$storedFile = StoredFile::RecallByGunid($gunid);
|
$storedFile = StoredFile::RecallByGunid($gunid);
|
||||||
if (PEAR::isError($storedFile)) {
|
if (is_null($storedFile) || PEAR::isError($storedFile)) {
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
// handle metadata:
|
// handle metadata:
|
||||||
|
@ -333,7 +333,7 @@ class Transport
|
||||||
$plid = $gunid;
|
$plid = $gunid;
|
||||||
require_once("Playlist.php");
|
require_once("Playlist.php");
|
||||||
$pl = StoredFile::RecallByGunid($plid);
|
$pl = StoredFile::RecallByGunid($plid);
|
||||||
if (PEAR::isError($pl)) {
|
if (is_null($pl) || PEAR::isError($pl)) {
|
||||||
return $pl;
|
return $pl;
|
||||||
}
|
}
|
||||||
$fname = $pl->getName();
|
$fname = $pl->getName();
|
||||||
|
@ -1107,7 +1107,7 @@ class Transport
|
||||||
if ($state2 == 'paused' || $state2 == 'closed' ) {
|
if ($state2 == 'paused' || $state2 == 'closed' ) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// status 18 - Partial file. Only a part of the file was transported.
|
// status 18 - Partial file. Only a part of the file was transported.
|
||||||
// status 28 - Timeout. Too long/slow upload, try to resume next time rather.
|
// status 28 - Timeout. Too long/slow upload, try to resume next time rather.
|
||||||
|
@ -1202,7 +1202,7 @@ class Transport
|
||||||
if ($state2 == 'paused' || $state2 == 'closed' ) {
|
if ($state2 == 'paused' || $state2 == 'closed' ) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check consistency
|
// check consistency
|
||||||
$size = filesize($row['localfile']);
|
$size = filesize($row['localfile']);
|
||||||
if ($size < $row['expectedsize']) {
|
if ($size < $row['expectedsize']) {
|
||||||
|
|
|
@ -166,15 +166,17 @@ if (!is_null($this_file)) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// make dirpaths better (without ../)
|
// make dirpaths better (without "../")
|
||||||
foreach (array('storageDir', 'bufferDir', 'transDir', 'accessDir', 'pearPath', 'cronDir') as $d) {
|
foreach (array('storageDir', 'bufferDir', 'transDir', 'accessDir', 'pearPath', 'cronDir') as $d) {
|
||||||
$rp = realpath($CC_CONFIG[$d]);
|
$rp = realpath($CC_CONFIG[$d]);
|
||||||
// workaround for missing dirs
|
// workaround for missing dirs
|
||||||
if ( $rp === FALSE ) {
|
// if ( $rp === FALSE ) {
|
||||||
mkdir( $CC_CONFIG[$d] );
|
// mkdir( $CC_CONFIG[$d] );
|
||||||
$rp = realpath($CC_CONFIG[$d]);
|
// $rp = realpath($CC_CONFIG[$d]);
|
||||||
|
// }
|
||||||
|
if ($rp) {
|
||||||
|
$CC_CONFIG[$d] = $rp;
|
||||||
}
|
}
|
||||||
$CC_CONFIG[$d] = $rp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -8,7 +8,8 @@ define('CRON_EMPTY', 4);
|
||||||
/**
|
/**
|
||||||
* A class that interfaces with the crontab. (cjpa@audiophile.com)
|
* A class that interfaces with the crontab. (cjpa@audiophile.com)
|
||||||
*
|
*
|
||||||
* This class lets you manipulate the crontab. It lets you add delete update entries easily.
|
* This class lets you manipulate a user's crontab.
|
||||||
|
* It lets you add delete update entries easily.
|
||||||
*
|
*
|
||||||
* @author $Author: $
|
* @author $Author: $
|
||||||
* @version $Revision: $
|
* @version $Revision: $
|
||||||
|
@ -70,9 +71,10 @@ class Crontab
|
||||||
*/
|
*/
|
||||||
function readCrontab()
|
function readCrontab()
|
||||||
{
|
{
|
||||||
|
// Hmmm...this line looks like it erases the crontab file. -Paul
|
||||||
@exec("echo | crontab -u {$this->user} -", $crons, $return);
|
@exec("echo | crontab -u {$this->user} -", $crons, $return);
|
||||||
@exec("crontab -u {$this->user} -l", $crons, $return);
|
@exec("crontab -u {$this->user} -l", $crons, $return);
|
||||||
if($return != 0){
|
if ($return != 0) {
|
||||||
return PEAR::raiseError("*** Can't read crontab ***\n".
|
return PEAR::raiseError("*** Can't read crontab ***\n".
|
||||||
" Set crontab manually!\n");
|
" Set crontab manually!\n");
|
||||||
}
|
}
|
||||||
|
@ -82,32 +84,28 @@ class Crontab
|
||||||
$line = trim($line); // discarding all prepending spaces and tabs
|
$line = trim($line); // discarding all prepending spaces and tabs
|
||||||
|
|
||||||
// empty lines..
|
// empty lines..
|
||||||
if (!$line)
|
if (!$line) {
|
||||||
{
|
|
||||||
$this->crontabs[] = "empty line";
|
$this->crontabs[] = "empty line";
|
||||||
$this->linetypes[] = CRON_EMPTY;
|
$this->linetypes[] = CRON_EMPTY;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// checking if this is a comment
|
// checking if this is a comment
|
||||||
if ($line[0] == "#")
|
if ($line[0] == "#") {
|
||||||
{
|
|
||||||
$this->crontabs[] = trim($line);
|
$this->crontabs[] = trim($line);
|
||||||
$this->linetypes[] = CRON_COMMENT;
|
$this->linetypes[] = CRON_COMMENT;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checking if this is an assignment
|
// Checking if this is an assignment
|
||||||
if (ereg("(.*)=(.*)", $line, $assign))
|
if (ereg("(.*)=(.*)", $line, $assign)) {
|
||||||
{
|
|
||||||
$this->crontabs[] = array ("name" => $assign[1], "value" => $assign[2]);
|
$this->crontabs[] = array ("name" => $assign[1], "value" => $assign[2]);
|
||||||
$this->linetypes[] = CRON_ASSIGN;
|
$this->linetypes[] = CRON_ASSIGN;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checking if this is a special @-entry. check man 5 crontab for more info
|
// Checking if this is a special @-entry. check man 5 crontab for more info
|
||||||
if ($line[0] == '@')
|
if ($line[0] == '@') {
|
||||||
{
|
|
||||||
$this->crontabs[] = split("[ \t]", $line, 2);
|
$this->crontabs[] = split("[ \t]", $line, 2);
|
||||||
$this->linetypes[] = CRON_SPECIAL;
|
$this->linetypes[] = CRON_SPECIAL;
|
||||||
continue;
|
continue;
|
||||||
|
@ -129,36 +127,34 @@ class Crontab
|
||||||
$filename = ($DEBUG ? tempnam("$PATH/crons", "cron") : tempnam("/tmp", "cron"));
|
$filename = ($DEBUG ? tempnam("$PATH/crons", "cron") : tempnam("/tmp", "cron"));
|
||||||
$file = fopen($filename, "w");
|
$file = fopen($filename, "w");
|
||||||
|
|
||||||
for ($i = 0; $i < count($this->linetypes); $i ++)
|
for ($i = 0; $i < count($this->linetypes); $i ++) {
|
||||||
{
|
switch ($this->linetypes[$i]) {
|
||||||
switch ($this->linetypes[$i])
|
case CRON_COMMENT:
|
||||||
{
|
|
||||||
case CRON_COMMENT :
|
|
||||||
$line = $this->crontabs[$i];
|
$line = $this->crontabs[$i];
|
||||||
break;
|
break;
|
||||||
case CRON_ASSIGN :
|
case CRON_ASSIGN:
|
||||||
$line = $this->crontabs[$i][name]." = ".$this->crontabs[$i][value];
|
$line = $this->crontabs[$i][name]." = ".$this->crontabs[$i][value];
|
||||||
break;
|
break;
|
||||||
case CRON_CMD :
|
case CRON_CMD:
|
||||||
$line = implode(" ", $this->crontabs[$i]);
|
$line = implode(" ", $this->crontabs[$i]);
|
||||||
break;
|
break;
|
||||||
case CRON_SPECIAL :
|
case CRON_SPECIAL:
|
||||||
$line = implode(" ", $this->crontabs[$i]);
|
$line = implode(" ", $this->crontabs[$i]);
|
||||||
break;
|
break;
|
||||||
case CRON_EMPTY :
|
case CRON_EMPTY:
|
||||||
$line = "\n"; // an empty line in the crontab-file
|
$line = "\n"; // an empty line in the crontab-file
|
||||||
break;
|
break;
|
||||||
default :
|
default:
|
||||||
unset ($line);
|
unset($line);
|
||||||
echo "Something very weird is going on. This line ($i) has an unknown type.\n";
|
echo "Something very weird is going on. This line ($i) has an unknown type.\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// echo "line $i : $line\n";
|
// echo "line $i : $line\n";
|
||||||
|
|
||||||
if ($line){
|
if ($line) {
|
||||||
$r = @fwrite($file, $line."\n");
|
$r = @fwrite($file, $line."\n");
|
||||||
if($r === FALSE){
|
if($r === FALSE) {
|
||||||
return PEAR::raiseError("*** Can't write crontab ***\n".
|
return PEAR::raiseError("*** Can't write crontab ***\n".
|
||||||
" Set crontab manually!\n");
|
" Set crontab manually!\n");
|
||||||
}
|
}
|
||||||
|
@ -166,27 +162,34 @@ class Crontab
|
||||||
}
|
}
|
||||||
fclose($file);
|
fclose($file);
|
||||||
|
|
||||||
if ($DEBUG)
|
if ($DEBUG) {
|
||||||
echo "DEBUGMODE: not updating crontab. writing to $filename instead.\n";
|
echo "DEBUGMODE: not updating crontab. writing to $filename instead.\n";
|
||||||
else
|
} else {
|
||||||
{
|
|
||||||
exec("crontab -u {$this->user} $filename", $returnar, $return);
|
exec("crontab -u {$this->user} $filename", $returnar, $return);
|
||||||
if ($return != 0)
|
if ($return != 0) {
|
||||||
echo "Error running crontab ($return). $filename not deleted\n";
|
echo "Error running crontab ($return). $filename not deleted\n";
|
||||||
else
|
} else {
|
||||||
unlink($filename);
|
unlink($filename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a item of type CRON_CMD to the end of $this->crontabs
|
* Add a item of type CRON_CMD to the end of $this->crontabs
|
||||||
*
|
*
|
||||||
* @param string $m minute
|
* @param string $m
|
||||||
* @param string $h hour
|
* minute
|
||||||
* @param string $dom day of month
|
* @param string $h
|
||||||
* @param string $mo month
|
* hour
|
||||||
* @param string $dow day of week
|
* @param string $dom
|
||||||
* @param string $cmd command
|
* day of month
|
||||||
|
* @param string $mo
|
||||||
|
* month
|
||||||
|
* @param string $dow
|
||||||
|
* day of week
|
||||||
|
* @param string $cmd
|
||||||
|
* command
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function addCron($m, $h, $dom, $mo, $dow, $cmd)
|
function addCron($m, $h, $dom, $mo, $dow, $cmd)
|
||||||
|
@ -195,10 +198,11 @@ class Crontab
|
||||||
$this->linetypes[] = CRON_CMD;
|
$this->linetypes[] = CRON_CMD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a comment to the cron to the end of $this->crontabs
|
* Add a comment to the cron to the end of $this->crontabs
|
||||||
*
|
*
|
||||||
* @param string $comment comment
|
* @param string $comment
|
||||||
*/
|
*/
|
||||||
function addComment($comment)
|
function addComment($comment)
|
||||||
{
|
{
|
||||||
|
@ -206,6 +210,7 @@ class Crontab
|
||||||
$this->linetypes[] = CRON_COMMENT;
|
$this->linetypes[] = CRON_COMMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a special command (check man 5 crontab for more information)
|
* Add a special command (check man 5 crontab for more information)
|
||||||
*
|
*
|
||||||
|
@ -228,11 +233,12 @@ class Crontab
|
||||||
$this->linetypes[] = CRON_SPECIAL;
|
$this->linetypes[] = CRON_SPECIAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an assignment (name = value)
|
* Add an assignment (name = value)
|
||||||
*
|
*
|
||||||
* @param string $name name of assingation
|
* @param string $name
|
||||||
* @param string $value value
|
* @param string $value
|
||||||
*/
|
*/
|
||||||
function addAssign($name, $value)
|
function addAssign($name, $value)
|
||||||
{
|
{
|
||||||
|
@ -240,6 +246,7 @@ class Crontab
|
||||||
$this->linetypes[] = CRON_ASSIGN;
|
$this->linetypes[] = CRON_ASSIGN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete a line from the arrays.
|
* Delete a line from the arrays.
|
||||||
*
|
*
|
||||||
|
@ -251,10 +258,11 @@ class Crontab
|
||||||
unset ($this->linetypes[$index]);
|
unset ($this->linetypes[$index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all the lines of a certain type in an array
|
* Get all the lines of a certain type in an array
|
||||||
*
|
*
|
||||||
* @param string $type linetype
|
* @param string $type
|
||||||
*/
|
*/
|
||||||
function getByType($type)
|
function getByType($type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -376,6 +376,10 @@ if (!camp_db_table_exists($CC_CONFIG['accessTable'])) {
|
||||||
echo " * Inserting starting data into tables...\n";
|
echo " * Inserting starting data into tables...\n";
|
||||||
$gb = new GreenBox();
|
$gb = new GreenBox();
|
||||||
$r = $gb->initData(true);
|
$r = $gb->initData(true);
|
||||||
|
if (PEAR::isError($r)) {
|
||||||
|
echo "\n * ERROR: ";
|
||||||
|
print_r($r);
|
||||||
|
}
|
||||||
//echo "done.\n";
|
//echo "done.\n";
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue