Skip to content
Extraits de code Groupes Projets
Valider 985f51d2 rédigé par mattab's avatar mattab
Parcourir les fichiers

Merge remote-tracking branch 'origin/multi_superuser' into multi_superuser

parents f81dcbc3 7926d205
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
; <?php exit; ?> DO NOT REMOVE THIS LINE
; file automatically generated or modified by Piwik; you can manually override the default values in global.ini.php by redefining them in this file.
[database]
host = "localhost"
username = "root"
password = "secure"
dbname = "piwik2"
tables_prefix = "piwik_"
adapter = "PDO\MYSQL"
charset = "utf8"
[database_tests]
password = "secure"
[log]
log_writers[] = "file"
log_writers[] = "database"
logger_message[] = "database"
logger_error[] = "database"
logger_exception[] = "database"
[Debug]
track_visits_inside_piwik_ui = 1
disable_merged_assets = 1
enable_sql_profilerr = 1
[General]
trusted_hosts[] = "apache.piwik"
trusted_hosts[] = "nginx.piwik"
salt = "0e7ba14c88cf21e24d4e038d4b6800b2"
[mail]
transport = "smtp"
host = "smtp.gmail.com"
type = "Login"
username = "thomas.steur@googlemail.com"
password = "voekuphysyqaohpk"
encryption = "ssl"
[Plugins]
Plugins[] = "CorePluginsAdmin"
Plugins[] = "CoreAdminHome"
Plugins[] = "CoreHome"
Plugins[] = "CoreVisualizations"
Plugins[] = "Proxy"
Plugins[] = "API"
Plugins[] = "ExamplePlugin"
Plugins[] = "Widgetize"
Plugins[] = "Transitions"
Plugins[] = "LanguagesManager"
Plugins[] = "Actions"
Plugins[] = "Dashboard"
Plugins[] = "MultiSites"
Plugins[] = "Referrers"
Plugins[] = "UserSettings"
Plugins[] = "Goals"
Plugins[] = "SEO"
Plugins[] = "Events"
Plugins[] = "UserCountry"
Plugins[] = "VisitsSummary"
Plugins[] = "VisitFrequency"
Plugins[] = "VisitTime"
Plugins[] = "VisitorInterest"
Plugins[] = "ExampleAPI"
Plugins[] = "ExampleRssWidget"
Plugins[] = "Provider"
Plugins[] = "Feedback"
Plugins[] = "Login"
Plugins[] = "UsersManager"
Plugins[] = "SitesManager"
Plugins[] = "Installation"
Plugins[] = "CoreUpdater"
Plugins[] = "CoreConsole"
Plugins[] = "UserCountryMap"
Plugins[] = "Live"
Plugins[] = "CustomVariables"
Plugins[] = "PrivacyManager"
Plugins[] = "ImageGraph"
Plugins[] = "Annotations"
Plugins[] = "Overlay"
Plugins[] = "SegmentEditor"
Plugins[] = "Morpheus"
Plugins[] = "Zeitgeist"
Plugins[] = "ScheduledReports"
Plugins[] = "CustomAlerts"
Plugins[] = "TasksTimetable"
Plugins[] = "MobileMessaging"
[PluginsInstalled]
PluginsInstalled[] = "Login"
PluginsInstalled[] = "CoreAdminHome"
PluginsInstalled[] = "UsersManager"
PluginsInstalled[] = "SitesManager"
PluginsInstalled[] = "Installation"
PluginsInstalled[] = "CorePluginsAdmin"
PluginsInstalled[] = "CoreHome"
PluginsInstalled[] = "CoreVisualizations"
PluginsInstalled[] = "Proxy"
PluginsInstalled[] = "API"
PluginsInstalled[] = "ExamplePlugin"
PluginsInstalled[] = "Widgetize"
PluginsInstalled[] = "Transitions"
PluginsInstalled[] = "LanguagesManager"
PluginsInstalled[] = "Actions"
PluginsInstalled[] = "Dashboard"
PluginsInstalled[] = "MultiSites"
PluginsInstalled[] = "Referrers"
PluginsInstalled[] = "UserSettings"
PluginsInstalled[] = "Goals"
PluginsInstalled[] = "SEO"
PluginsInstalled[] = "Events"
PluginsInstalled[] = "UserCountry"
PluginsInstalled[] = "VisitsSummary"
PluginsInstalled[] = "VisitFrequency"
PluginsInstalled[] = "VisitTime"
PluginsInstalled[] = "VisitorInterest"
PluginsInstalled[] = "ExampleAPI"
PluginsInstalled[] = "ExampleRssWidget"
PluginsInstalled[] = "Provider"
PluginsInstalled[] = "Feedback"
PluginsInstalled[] = "CoreUpdater"
PluginsInstalled[] = "CoreConsole"
PluginsInstalled[] = "ScheduledReports"
PluginsInstalled[] = "UserCountryMap"
PluginsInstalled[] = "Live"
PluginsInstalled[] = "CustomVariables"
PluginsInstalled[] = "PrivacyManager"
PluginsInstalled[] = "ImageGraph"
PluginsInstalled[] = "DoNotTrack"
PluginsInstalled[] = "Annotations"
PluginsInstalled[] = "MobileMessaging"
PluginsInstalled[] = "Overlay"
PluginsInstalled[] = "SegmentEditor"
PluginsInstalled[] = "Morpheus"
PluginsInstalled[] = "Zeitgeist"
PluginsInstalled[] = "CustomAlerts"
PluginsInstalled[] = "LiveTab"
PluginsInstalled[] = "AnonymizeIP"
PluginsInstalled[] = "DBStats"
PluginsInstalled[] = "DevicesDetection"
PluginsInstalled[] = "ExampleCommand"
PluginsInstalled[] = "ExampleSettingsPlugin"
PluginsInstalled[] = "ExampleTheme"
PluginsInstalled[] = "ExampleUI"
PluginsInstalled[] = "ExampleVisualization"
PluginsInstalled[] = "LeftMenu"
PluginsInstalled[] = "VisitorGenerator"
PluginsInstalled[] = "TasksTimetable"
[Plugins_Tracker]
Plugins_Tracker[] = "Provider"
Plugins_Tracker[] = "Goals"
Plugins_Tracker[] = "UserCountry"
Plugins_Tracker[] = "UsersManager"
Plugins_Tracker[] = "SitesManager"
Plugins_Tracker[] = "DevicesDetection"
Plugins_Tracker[] = "PrivacyManager"
Plugins_Tracker[] = "Login"
......@@ -14,6 +14,7 @@ use HTML_QuickForm2_DataSource_Array;
use HTML_QuickForm2_Factory;
use HTML_QuickForm2_Rule;
use Piwik\Piwik;
use Piwik\Plugins\UsersManager\UsersManager;
use Piwik\QuickForm2;
/**
......@@ -40,6 +41,10 @@ class FormGeneralSetup extends QuickForm2
$password = $this->addElement('password', 'password')
->setLabel(Piwik::translate('Installation_Password'));
$password->addRule('required', Piwik::translate('General_Required', Piwik::translate('Installation_Password')));
$pwMinLen = UsersManager::PASSWORD_MIN_LENGTH;
$pwMaxLen = UsersManager::PASSWORD_MAX_LENGTH;
$pwLenInvalidMessage = Piwik::translate('UsersManager_ExceptionInvalidPassword', array($pwMinLen, $pwMaxLen));
$password->addRule('length', $pwLenInvalidMessage, array('min' => $pwMinLen, 'max' => $pwMaxLen));
$passwordBis = $this->addElement('password', 'password_bis')
->setLabel(Piwik::translate('Installation_PasswordRepeat'));
......
......@@ -115,7 +115,7 @@ class API extends \Piwik\Plugin\API
protected function checkUserCanModifySegment($segment)
{
if(Piwik::isUserIsSuperUser()) {
if(Piwik::hasUserSuperUserAccess()) {
return;
}
if($segment['login'] != Piwik::getCurrentUserLogin()) {
......
......@@ -11,6 +11,7 @@ use Piwik\Date;
use Piwik\Db;
use Piwik\DbHelper;
use Piwik\Plugins\VisitsSummary\API;
use Piwik\Plugins\UsersManager\API as UsersManagerApi;
use Piwik\ArchiveProcessor\Rules;
abstract class UITest extends IntegrationTestCase
......@@ -48,7 +49,9 @@ abstract class UITest extends IntegrationTestCase
parent::setUpBeforeClass();
DbHelper::createAnonymousUser();
UsersManagerApi::getInstance()->addUser('superUserLogin', 'test', 'hello2@example.org');
UsersManagerApi::getInstance()->setSuperUserAccess('superUserLogin', true);
AssetManager::getInstance()->removeMergedAssets();
// launch archiving so tests don't run out of time
......@@ -393,4 +396,4 @@ Screenshot diff: $diffPath\n";
$this->assertTrue($expected == $processed, "screenshot compare failed for '$processedPath'");
}
}
\ No newline at end of file
}
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter