Exemplo n.º 1
0
    print "<h2>Error</h2><br />I can not access the directory {$recordings_directory}. ";
    print "Please make sure that it exists, and is writable by the web server.";
    return false;
}
$sql = "SELECT * FROM recordings where displayname = '__invalid'";
$results = $db->getRow($sql, DB_FETCHMODE_ASSOC);
if (!isset($results['filename'])) {
    sql("INSERT INTO recordings (displayname, filename, description) VALUES ( '__invalid', 'install done', '');");
    $dh = opendir($recordings_directory);
    while (false !== ($file = readdir($dh))) {
        // http://au3.php.net/readdir
        if ($file[0] != "." && $file != "CVS" && $file != "svn" && !is_dir("{$recordings_directory}/{$file}")) {
            // Ignore the suffix..
            $fname = ereg_replace('.wav', '', $file);
            $fname = ereg_replace('.gsm', '', $fname);
            if (recordings_get_id("custom/{$fname}") == null) {
                recordings_add($fname, "custom/{$file}");
            }
        }
    }
}
global $db;
// Upgrade to recordings 3.0
// Change filename from VARCHAR(80) to BLOB
// Upgrade to recordings 3.0
// Change filename from VARCHAR(80) to BLOB
// no need to add this if we are on sqlite, since the initial tables will
// include the correct columns already.
if ($amp_conf["AMPDBENGINE"] != "sqlite" && $amp_conf["AMPDBENGINE"] != "sqlite3") {
    $sql = 'ALTER TABLE recordings CHANGE filename filename BLOB';
    $result = $db->query($sql);
Exemplo n.º 2
0
function recordings_get_or_create_id($fn, $module)
{
    $id = recordings_get_id($fn);
    if ($id != null) {
        return $id;
    } else {
        // Create the id, name it the file name or if multi-part ...
        //
        $dname = explode('&', $displayname);
        $displayname = 'auto-created: ';
        $displayname .= count($dname) == 1 ? $fn : $dname[0] . "&...";
        $description = sprintf(_("Missing Sound file auto-created from migration of %s module"), $module);
        recordings_add($displayname, $fn, $description = '');
        // get the id we just created
        //
        $id = recordings_get_id($fn);
        // Notify of issue
        //
        $nt =& notifications::create($db);
        $text = sprintf(_("Non-Existent Recording in module %s"), $module);
        $extext = sprintf(_("The %s referenced a recording file listed below that does not exists. An entry has been generated, named %s, with the referenced file(s) but you should confirm that it really works and the real files exist. The file(s) referenced: %s "), $module, $displayname, $fn);
        $nt->add_error('recordings', 'NEWREC-' . $id, $text, $extext, '', true, true);
        unset($nt);
        // return the id just created
        return $id;
    }
}
Exemplo n.º 3
0
$fc_save = $fcc->getCodeActive();
unset($fcc);
$fcc = new featurecode('recordings', 'record_check');
$fc_check = $fcc->getCodeActive();
unset($fcc);
$fc_save = $fc_save != '' ? $fc_save : _('** MISSING FEATURE CODE **');
$fc_check = $fc_check != '' ? $fc_check : _('** MISSING FEATURE CODE **');
switch ($action) {
    case "system":
        recording_sidebar(-1, null);
        recording_sysfiles();
        break;
    case "newsysrec":
        $sysrecs = recordings_readdir($astsnd, strlen($astsnd) + 1);
        if (recordings_add($sysrecs[$sysrec], $sysrecs[$sysrec])) {
            $id = recordings_get_id($sysrecs[$sysrec]);
        } else {
            $id = 0;
        }
        recording_sidebar($id, null);
        recording_editpage($id, null);
        break;
    case "recorded":
        // Clean up the filename,suffix, take out any nasty characters
        $filename = escapeshellcmd(strtr($rname, '/ ', '__'));
        $suffix = escapeshellcmd(strtr($suffix, '/ ', '__'));
        if (!file_exists($astsnd . "custom")) {
            if (!mkdir($astsnd . "custom", 0775)) {
                echo '<div class="content"><h5>' . _("Failed to create") . ' ' . $astsnd . 'custom' . '</h5>';
            }
        } else {