1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-06 03:49:56 +02:00

updated translations, new russian translation, generate config tool to update config and new putenv test on /test.php

This commit is contained in:
Karl 'vollmerk' Vollmer 2006-10-22 09:24:39 +00:00
parent 7b49a436d0
commit a528277904
18 changed files with 4079 additions and 1749 deletions

111
admin/system.php Normal file
View file

@ -0,0 +1,111 @@
<?php
/*
Copyright (c) 2001 - 2006 Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
require('../lib/init.php');
require_once(conf('prefix') . '/lib/debug.lib.php');
require_once(conf('prefix') . '/modules/horde/Browser.php');
if (!$GLOBALS['user']->has_access(100)) {
access_denied();
exit();
}
$action = scrub_in($_REQUEST['action']);
/* Switch on action boys */
switch ($action) {
/* This re-generates the config file comparing
* /config/ampache.cfg to .cfg.dist
*/
case 'generate_config':
$configfile = conf('prefix') . '/config/ampache.cfg.php';
$distfile = conf('prefix') . '/config/ampache.cfg.php.dist';
/* Load the current config file */
$current = read_config($configfile, 0, 0);
/* Start building the new config file */
$handle = fopen($distfile,'r');
$dist = fread($handle,filesize($distfile));
fclose($handle);
$data = explode("\n",$dist);
/* Run throught the lines and set our settings */
foreach ($data as $line) {
/* Attempt to pull out Key */
if (preg_match("/^#?([\w\d]+)\s+=\s+[\"]{1}(.*?)[\"]{1}$/",$line,$matches)
|| preg_match("/^#?([\w\d]+)\s+=\s+[\']{1}(.*?)[\']{1}$/", $line, $matches)
|| preg_match("/^#?([\w\d]+)\s+=\s+[\'\"]{0}(.*)[\'\"]{0}$/",$line,$matches)) {
$key = $matches[1];
$value = $matches[2];
/* Check to see if Key on source side is an array */
if (is_array($current[$key])) {
/* We need to add all values of this key to the new config file */
$line = '';
$array_value[$key] = true;
foreach ($current[$key] as $sub_value) {
$line .= $key . " = \"" . $sub_value . "\"\n";
}
unset($current[$key]);
} // is array
/* Put in the current value */
elseif (isset($current[$key])) {
$line = $key . " = \"" . $current[$key] . "\"";
unset($current[$key]);
} // if set
elseif (isset($array_value[$key])) {
$line = '';
}
} // if key
$final .= $line . "\n";
} // end foreach dist file contents
/* Set Correct Headers */
$browser = new Browser();
$browser->downloadHeaders("ampache.cfg.php","text/plain",false,filesize("config/ampache.cfg.php.dist"));
echo $final;
break;
/* Check this version against ampache.org's record */
case 'check_version':
break;
default:
// Rien a faire
break;
} // end switch
?>

View file

@ -22,7 +22,7 @@
$no_session = '1';
require ('../lib/init.php');
require ('../lib/debug.php');
require ('../lib/debug.lib.php');
$results = debug_read_config(conf('prefix') . "/config/ampache.cfg.php");

View file

@ -4,6 +4,12 @@
--------------------------------------------------------------------------
v.3.3.3-Alpha1
- Added Generate Config tool for admins to update their configs
to the latest version. It reads current settings and merges
with the new config file and prompts for a download
- Added PutENV check on test page to make sure we can redefine
memory limit and safemode is off
- Added Russian translation (Thx Dimon)
- Fixed a problem with vainfo ignoring file pattern if no other
tags were found
- Added new version of getid3() library which will hopefully

View file

@ -28,7 +28,7 @@ require_once('lib/ui.lib.php');
require_once('modules/horde/Browser.php');
require_once('lib/install.php');
require_once('modules/lib.php');
require_once('lib/debug.php');
require_once('lib/debug.lib.php');
require_once('lib/class/user.class.php');
require_once('lib/class/error.class.php');
require_once('lib/gettext.php');

View file

@ -266,8 +266,6 @@ function debug_read_config($config_file,$debug) {
$value = trim($value);
if (substr($value,0,1) == '#') { continue; }
if (preg_match("/^#?([\w\d]+)\s+=\s+[\"]{1}(.*?)[\"]{1}$/",$value,$matches)
|| preg_match("/^#?([\w\d]+)\s+=\s+[\']{1}(.*?)[\']{1}$/", $value, $matches)
|| preg_match("/^#?([\w\d]+)\s+=\s+[\'\"]{0}(.*)[\'\"]{0}$/",$value,$matches)) {
@ -340,4 +338,31 @@ function debug_compare_configs($config,$dist_config) {
} // debug_compare_configs
/**
* check_putenv
* This checks to see if we can manually set the
* memory limit, and other putenvs we need for
* ampache to work correctly
*/
function check_putenv() {
/* Check memory */
$current = ini_get('memory_limit');
$current = substr($current_memory,0,strlen($current_memory)-1);
$new_limit = ($current+1) . "M";
/* Bump it by one meg */
if (!ini_set(memory_limit,$new_limit)) {
return false;
}
/* Check if safe mode is on */
if (ini_get('safe_mode')) {
return false;
}
return true;
} // check_putenv
?>

View file

@ -80,7 +80,7 @@ if (!$results['allow_stream_playback']) {
/** This is the version.... fluf nothing more... **/
$results['version'] = '3.3.3-Alpha1 (Build 003)';
$results['version'] = '3.3.3-Alpha1 (Build 004)';
$results['raw_web_path'] = $results['web_path'];
$results['web_path'] = $http_type . $_SERVER['HTTP_HOST'] . $results['web_path'];

View file

@ -9,3 +9,4 @@ msgmerge ./messages.po ../it_IT/LC_MESSAGES/messages.po --output-file=../it_IT/L
msgmerge ./messages.po ../nl_NL/LC_MESSAGES/messages.po --output-file=../nl_NL/LC_MESSAGES/messages.po
msgmerge ./messages.po ../tr_TR/LC_MESSAGES/messages.po --output-file=../tr_TR/LC_MESSAGES/messages.po
msgmerge ./messages.po ../zh_CN/LC_MESSAGES/messages.po --output-file=../zh_CN/LC_MESSAGES/messages.po
msgmerge ./messages.po ../ru_RU/LC_MESSAGES/messages.po --output-file=../ru_RU/LC_MESSAGES/messages.po

File diff suppressed because it is too large Load diff

View file

@ -1825,9 +1825,8 @@ msgid "Next"
msgstr ""
#: ../../templates/show_localplay.inc:49
#, fuzzy
msgid "Volume"
msgstr "Wert"
msgstr ""
#: ../../templates/show_localplay.inc:53 ../../templates/show_localplay.inc:54
msgid "Increase Volume"
@ -2500,10 +2499,10 @@ msgid "Sorry, you don't have access to that part of the server."
msgstr "Entschuldigung, sie haben keinen Zugriff auf diesen Teil des Servers."
msgid "No Songs Removed"
msgstr "Keine Lieder gelscht"
msgstr ""
msgid "No Disabled songs found"
msgstr "Keine 'abgeschalteten' Lieder gefunden"
msgstr ""
msgid "Popular Threshold"
msgstr "Weiter"

View file

@ -186,7 +186,7 @@ msgstr ""
#: ../../lib/class/catalog.class.php:1138
msgid "Checking"
msgstr ""
msgstr "Véfication"
#: ../../lib/class/catalog.class.php:1196
msgid "Catalog Clean Done"
@ -340,7 +340,7 @@ msgstr "Erreur, ne peut pas écrire"
#: ../../lib/class/stream.class.php:214
msgid "Error, cannot write song in file"
msgstr ""
msgstr "Erreur, ne peut pas écrire chanson dans le "fichier"
#: ../../lib/class/stream.class.php:220
msgid "Closed after write"
@ -498,7 +498,7 @@ msgstr "Parcourir"
#: ../../lib/ui.lib.php:301
msgid "Show w/o art"
msgstr ""
msgstr "Montrer sans l'art"
#: ../../lib/ui.lib.php:304
msgid "Show all"

View file

@ -35,7 +35,7 @@ msgstr ""
#: ../../lib/class/catalog.class.php:365
msgid "Added"
msgstr "Toegevoegd"
msgstr ""
#: ../../lib/class/catalog.class.php:377
msgid "is not readable by ampache"

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -35,7 +35,7 @@ msgstr ""
#: ../../lib/class/catalog.class.php:365
msgid "Added"
msgstr "Eklendi"
msgstr ""
#: ../../lib/class/catalog.class.php:377
msgid "is not readable by ampache"
@ -1821,7 +1821,7 @@ msgstr ""
#: ../../templates/show_localplay.inc:49
msgid "Volume"
msgstr "Ses"
msgstr ""
#: ../../templates/show_localplay.inc:53 ../../templates/show_localplay.inc:54
msgid "Increase Volume"

View file

@ -1032,7 +1032,6 @@ msgid "Play Random Selection"
msgstr ""
#: ../../templates/show_random_play_bar.inc.php:51
#, fuzzy
msgid "Full Artists"
msgstr ""
@ -1046,7 +1045,6 @@ msgid "from"
msgstr ""
#: ../../templates/show_random_play_bar.inc.php:59
#, fuzzy
msgid "Advanced"
msgstr ""
@ -1229,7 +1227,6 @@ msgid "Create New Playlist"
msgstr ""
#: ../../templates/show_playlist_box.inc.php:35
#, fuzzy
msgid "View All Playlists"
msgstr ""
@ -1452,7 +1449,6 @@ msgid "Error: Upload directory not inside a catalog"
msgstr ""
#: ../../bin/quarantine_migration.php.inc:74
#, fuzzy
msgid "Moved"
msgstr ""
@ -1501,7 +1497,6 @@ msgid "!\n"
msgstr ""
#: ../../templates/show_admin_index.inc:27
#, fuzzy
msgid "User Management"
msgstr ""
@ -1510,7 +1505,6 @@ msgid "E-mail Management"
msgstr ""
#: ../../templates/show_admin_index.inc:29
#, fuzzy
msgid "Catalog Managment"
msgstr ""
@ -1531,7 +1525,6 @@ msgid "Clear Now Playing"
msgstr ""
#: ../../templates/show_admin_index.inc:36
#, fuzzy
msgid "Add Access List Entry"
msgstr ""
@ -1540,7 +1533,6 @@ msgid "Common Functions"
msgstr ""
#: ../../templates/show_admin_index.inc:43
#, fuzzy
msgid "Admin Sections"
msgstr ""
@ -2288,7 +2280,6 @@ msgid "Object Type"
msgstr ""
#: ../../templates/show_search.inc:138
#, fuzzy
msgid "Genres"
msgstr ""

View file

@ -75,6 +75,10 @@ $users = $GLOBALS['user']->get_recent(10);
<div class="text-action">
<a href="<?php echo $web_path; ?>/admin/duplicates.php"><?php echo _('Show Duplicate Songs'); ?></a>
<a href="<?php echo $web_path; ?>/admin/catalog.php?action=clear_now_playing"><?php echo _('Clear Now Playing'); ?></a>
<hr noshade="noshade" size="3" />
<a href="<?php echo $web_path; ?>/admin/system.php?action=generate_config"><?php echo _('Generate New Config'); ?></a>
<!-- <a href="<?php echo $web_path; ?>/admin/system.php?action=check_version"><?php echo _('Check for New Version'); ?></a>
-->
</div>
<?php show_box_bottom(); ?>
<?php show_box_top(_('User Activity')); ?>

View file

@ -134,6 +134,23 @@ $row_classes = array('even','odd');
<?php echo _('This test makes sure you have PCRE support compiled into your version of PHP, this is required for Ampache.'); ?>
</td>
</tr>
<tr>
<td valign="top"><?php echo _('PHP PutENV Support'); ?></td>
<td valign="top">[
<?php
if (!check_putenv()) {
$status['putevn_php'] = false;
echo " <font color=\"red\">ERROR</font> ";
}
else {
echo "<font color=\"green\">&nbsp;&nbsp;&nbsp;OK&nbsp;&nbsp;&nbsp;&nbsp;</font> ";
}
?>]
</td>
<td>
<?php echo _('This test makes sure that PHP isn\'t running in SafeMode and that we are able to modify the memory limits. While not required, without these abilities some features of ampache may not work correctly'); ?>
</td>
</tr>
<tr>
<td valign="top"><?php echo _('Ampache.cfg.php Exists'); ?></td>
<td valign="top">[

View file

@ -31,7 +31,7 @@ require_once($prefix . "/lib/general.lib.php");
require_once($prefix . "/lib/ui.lib.php");
require_once($prefix . "/lib/class/error.class.php");
$error = new error();
require_once($prefix . "/lib/debug.php");
require_once($prefix . "/lib/debug.lib.php");