Commit 9b46a37c authored by Celine Noirot's avatar Celine Noirot
Browse files

Update installation, add email parameters

parent d67015f2
......@@ -44,7 +44,17 @@ from_password =
#to_address =
#subject =
#message =
#Purge email configuration
#if you want to use purge option, an email is sent
#In purge email you can fix for an extention :
# the minimal duration
min_extension_duration = 1 year
# the minimal size
min_extension_size = 1 Tbite
# the price for min_extension_duration * min_extension_size
min_extension_price = 300 Euros
#delay (in days) after sending an email to indicate that the data will be deleted
delay_purge = 30
[database]
host = localhost
user = typo3
......
......@@ -899,6 +899,7 @@ CREATE TABLE IF NOT EXISTS `tx_nG6_analyze` (
`purged_date` INT(11) NOT NULL ,
`purged_size` BIGINT NOT NULL ,
`mail_sent_date` INT(11) NOT NULL ,
`purge_demand_id` INT NULL DEFAULT NULL,
PRIMARY KEY (`uid`),
KEY `parent` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
......@@ -987,6 +988,7 @@ CREATE TABLE IF NOT EXISTS `tx_nG6_run` (
`purged_date` INT NOT NULL ,
`purged_size` BIGINT NOT NULL ,
`mail_sent_date` INT NOT NULL ,
`purge_demand_id` INT NULL DEFAULT NULL,
PRIMARY KEY (`uid`),
KEY `parent` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
......@@ -1109,6 +1111,38 @@ CREATE TABLE IF NOT EXISTS `tx_rtehtmlarea_acronym` (
KEY `parent` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `tx_nG6_purge_demand` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) NOT NULL DEFAULT '0',
`tstamp` int(11) NOT NULL DEFAULT '0',
`crdate` int(11) NOT NULL DEFAULT '0',
`cruser_id` int(11) NOT NULL DEFAULT '0',
`project_id` int(11) NOT NULL,
`purge_size` bigint(20),
`mail_sent_date` int(11),
`processed_date` int(11),
`demand_state` varchar(255),
`analyze_ids` TEXT NOT NULL ,
`run_ids` TEXT NOT NULL ,
PRIMARY KEY (`uid`),
KEY `parent` (`pid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=30060 ;
CREATE TABLE IF NOT EXISTS `tx_nG6_purge_demand_fe_users` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) NOT NULL DEFAULT '0',
`tstamp` int(11) NOT NULL DEFAULT '0',
`crdate` int(11) NOT NULL DEFAULT '0',
`cruser_id` int(11) NOT NULL DEFAULT '0',
`purge_demand_id` int(11),
`fe_users_id` int(11),
`message` text,
PRIMARY KEY (`uid`),
KEY `parent` (`pid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=30060 ;
INSERT INTO `be_users` (`uid`, `pid`, `tstamp`, `username`, `password`, `admin`, `usergroup`, `disable`, `starttime`, `endtime`, `lang`, `email`, `db_mountpoints`, `options`, `crdate`, `cruser_id`, `realName`, `userMods`, `allowed_languages`, `uc`, `file_mountpoints`, `fileoper_perms`, `workspace_perms`, `lockToDomain`, `disableIPlock`, `deleted`, `TSconfig`, `lastlogin`, `createdByAction`, `usergroup_cached_list`, `workspace_id`, `workspace_preview`) VALUES
(1, 0, 1381239486, 'admin_install', '$P$CbNAUHFOYcMbg2y5aE7yfWl/sAOqMF0', 1, '', 0, 0, 0, '', '', '', 0, 1381239486, 0, '', '', '', 'a:27:{s:14:"interfaceSetup";s:7:"backend";s:10:"moduleData";a:11:{s:8:"tools_em";a:5:{s:8:"function";s:11:"loaded_list";s:9:"listOrder";s:3:"cat";s:15:"display_details";s:1:"1";s:13:"singleDetails";s:4:"info";s:13:"extensionInfo";s:0:"";}s:10:"web_layout";a:2:{s:8:"function";s:1:"1";s:8:"language";s:1:"0";}s:12:"tools_config";a:2:{s:8:"function";s:1:"0";s:6:"node_0";a:1:{s:3:"SYS";i:1;}}s:16:"xMOD_alt_doc.php";a:0:{}s:6:"web_ts";a:2:{s:8:"function";s:17:"tx_tstemplateinfo";s:19:"constant_editor_cat";s:0:"";}s:8:"web_list";a:0:{}s:11:"alt_doc.php";a:2:{i:0;a:1:{s:32:"b2a52a64aeabdfa079e0aca938cff05a";a:4:{i:0;s:4:"Home";i:1;a:7:{s:4:"edit";a:1:{s:5:"pages";a:1:{i:1;s:4:"edit";}}s:7:"defVals";N;s:12:"overrideVals";N;s:11:"columnsOnly";N;s:7:"disHelp";N;s:6:"noView";N;s:24:"editRegularContentFromId";N;}i:2;s:99:"&edit[pages][1]=edit&defVals=&overrideVals=&columnsOnly=&disHelp=&noView=&editRegularContentFromId=";i:3;a:5:{s:5:"table";s:5:"pages";s:3:"uid";s:1:"1";s:3:"pid";s:1:"0";s:3:"cmd";s:4:"edit";s:12:"deleteAccess";i:1;}}}i:1;s:32:"fb7ba7367770a71d70f46f6c0b9f6e0d";}s:29:"t3lib_BEfunc::getUpdateSignal";a:0:{}s:16:"browse_links.php";a:1:{s:10:"expandPage";s:1:"5";}s:16:"opendocs::recent";a:5:{s:32:"fb7ba7367770a71d70f46f6c0b9f6e0d";a:4:{i:0;s:4:"+ext";i:1;a:7:{s:4:"edit";a:1:{s:12:"sys_template";a:1:{i:4;s:4:"edit";}}s:7:"defVals";N;s:12:"overrideVals";N;s:11:"columnsOnly";N;s:7:"disHelp";N;s:6:"noView";N;s:24:"editRegularContentFromId";N;}i:2;s:106:"&edit[sys_template][4]=edit&defVals=&overrideVals=&columnsOnly=&disHelp=&noView=&editRegularContentFromId=";i:3;a:5:{s:5:"table";s:12:"sys_template";s:3:"uid";s:1:"4";s:3:"pid";s:1:"4";s:3:"cmd";s:4:"edit";s:12:"deleteAccess";i:1;}}s:32:"c4af6f757b6bce2e8bff9a85ee10acd3";a:4:{i:0;s:4:"+ext";i:1;a:7:{s:4:"edit";a:1:{s:12:"sys_template";a:1:{i:3;s:4:"edit";}}s:7:"defVals";N;s:12:"overrideVals";N;s:11:"columnsOnly";N;s:7:"disHelp";N;s:6:"noView";N;s:24:"editRegularContentFromId";N;}i:2;s:106:"&edit[sys_template][3]=edit&defVals=&overrideVals=&columnsOnly=&disHelp=&noView=&editRegularContentFromId=";i:3;a:5:{s:5:"table";s:12:"sys_template";s:3:"uid";s:1:"3";s:3:"pid";s:1:"3";s:3:"cmd";s:4:"edit";s:12:"deleteAccess";i:1;}}s:32:"481f0e0c68eef987ca4a90100b2fde9d";a:4:{i:0;s:4:"+ext";i:1;a:7:{s:4:"edit";a:1:{s:12:"sys_template";a:1:{i:2;s:4:"edit";}}s:7:"defVals";N;s:12:"overrideVals";N;s:11:"columnsOnly";N;s:7:"disHelp";N;s:6:"noView";N;s:24:"editRegularContentFromId";N;}i:2;s:106:"&edit[sys_template][2]=edit&defVals=&overrideVals=&columnsOnly=&disHelp=&noView=&editRegularContentFromId=";i:3;a:5:{s:5:"table";s:12:"sys_template";s:3:"uid";s:1:"2";s:3:"pid";s:1:"2";s:3:"cmd";s:4:"edit";s:12:"deleteAccess";i:1;}}s:32:"99eb84e187fc30eeba3ec311ec622692";a:4:{i:0;s:8:"NEW SITE";i:1;a:7:{s:4:"edit";a:1:{s:12:"sys_template";a:1:{i:1;s:4:"edit";}}s:7:"defVals";N;s:12:"overrideVals";N;s:11:"columnsOnly";N;s:7:"disHelp";N;s:6:"noView";N;s:24:"editRegularContentFromId";N;}i:2;s:106:"&edit[sys_template][1]=edit&defVals=&overrideVals=&columnsOnly=&disHelp=&noView=&editRegularContentFromId=";i:3;a:5:{s:5:"table";s:12:"sys_template";s:3:"uid";s:1:"1";s:3:"pid";s:1:"1";s:3:"cmd";s:4:"edit";s:12:"deleteAccess";i:1;}}s:32:"b2a52a64aeabdfa079e0aca938cff05a";a:4:{i:0;s:4:"Home";i:1;a:7:{s:4:"edit";a:1:{s:5:"pages";a:1:{i:1;s:4:"edit";}}s:7:"defVals";N;s:12:"overrideVals";N;s:11:"columnsOnly";N;s:7:"disHelp";N;s:6:"noView";N;s:24:"editRegularContentFromId";N;}i:2;s:99:"&edit[pages][1]=edit&defVals=&overrideVals=&columnsOnly=&disHelp=&noView=&editRegularContentFromId=";i:3;a:5:{s:5:"table";s:5:"pages";s:3:"uid";s:1:"1";s:3:"pid";s:1:"0";s:3:"cmd";s:4:"edit";s:12:"deleteAccess";i:1;}}}s:13:"tools_install";a:1:{s:8:"function";s:0:"";}}s:19:"thumbnailsByDefault";i:1;s:14:"emailMeAtLogin";i:0;s:13:"condensedMode";i:0;s:10:"noMenuMode";i:0;s:11:"startModule";s:17:"help_aboutmodules";s:18:"hideSubmoduleIcons";i:0;s:8:"helpText";i:1;s:8:"titleLen";i:50;s:17:"edit_wideDocument";s:1:"0";s:18:"edit_showFieldHelp";s:4:"icon";s:8:"edit_RTE";s:1:"1";s:20:"edit_docModuleUpload";s:1:"1";s:19:"enableFlashUploader";s:1:"1";s:15:"disableCMlayers";i:0;s:13:"navFrameWidth";s:0:"";s:17:"navFrameResizable";i:0;s:15:"resizeTextareas";i:1;s:25:"resizeTextareas_MaxHeight";i:500;s:24:"resizeTextareas_Flexible";i:0;s:4:"lang";s:0:"";s:19:"firstLoginTimeStamp";i:1381239660;s:15:"moduleSessionID";a:11:{s:8:"tools_em";s:32:"bb989b13a3145bdfbe178325051c277f";s:10:"web_layout";s:32:"42ed621d6dfd7cff37981d8d584bcbf4";s:12:"tools_config";s:32:"bb989b13a3145bdfbe178325051c277f";s:16:"xMOD_alt_doc.php";s:32:"bb989b13a3145bdfbe178325051c277f";s:6:"web_ts";s:32:"bb989b13a3145bdfbe178325051c277f";s:8:"web_list";s:32:"bb989b13a3145bdfbe178325051c277f";s:11:"alt_doc.php";s:32:"bb989b13a3145bdfbe178325051c277f";s:29:"t3lib_BEfunc::getUpdateSignal";s:32:"bb989b13a3145bdfbe178325051c277f";s:16:"browse_links.php";s:32:"bb989b13a3145bdfbe178325051c277f";s:16:"opendocs::recent";s:32:"bb989b13a3145bdfbe178325051c277f";s:13:"tools_install";s:32:"bb989b13a3145bdfbe178325051c277f";}s:17:"BackendComponents";a:1:{s:6:"States";a:2:{s:19:"typo3-debug-console";O:8:"stdClass":1:{s:9:"collapsed";b:1;}s:8:"Pagetree";O:8:"stdClass":1:{s:9:"stateHash";O:8:"stdClass":8:{s:1:"0";i:1;s:1:"1";i:1;s:1:"2";i:1;s:1:"3";i:1;s:1:"4";i:1;s:1:"5";i:1;s:4:"root";i:1;s:16:"lastSelectedNode";s:2:"p6";}}}}s:18:"disablePMKTextarea";i:1;s:11:"browseTrees";a:1:{s:11:"browsePages";s:24:"a:1:{i:0;a:1:{i:0;i:1;}}";}}', '', 0, 1, '', 0, 0, NULL, 1382432509, 0, '', 0, 1);
......@@ -1175,6 +1209,28 @@ INSERT INTO `tt_content` (`uid`, `pid`, `t3ver_oid`, `t3ver_id`, `t3ver_wsid`, `
INSERT INTO `tx_nG6_project` (`uid`, `pid`, `tstamp`, `crdate`, `cruser_id`, `deleted`, `hidden`, `public`, `name`, `description`) VALUES
(1, 8, 1386341206, 1386341206, 1, 0, 0, 0, 'project_install', 'project_install');
--
-- Structure de la vue `tx_nG6_view_project_analyze`
--
CREATE ALGORITHM=UNDEFINED DEFINER=`typo3`@`localhost` SQL SECURITY DEFINER VIEW `tx_nG6_view_project_analyze` AS select `tx_nG6_project`.`uid` AS `project_id`,`tx_nG6_project`.`name` AS `project_name`,`tx_nG6_analyze`.`uid` AS `analyze_id`,`tx_nG6_analyze`.`storage_size` AS `storage_size`,`tx_nG6_analyze`.`purged_size` AS `purged_size`,`tx_nG6_analyze`.`data_state` AS `state`,`tx_nG6_analyze`.`retention_date` AS `retention_date`,`tx_nG6_analyze`.`purge_demand_id` AS `purge_demand_id` from ((`tx_nG6_project` join `tx_nG6_project_analyze` on((`tx_nG6_project_analyze`.`project_id` = `tx_nG6_project`.`uid`))) join `tx_nG6_analyze` on((`tx_nG6_project_analyze`.`analyze_id` = `tx_nG6_analyze`.`uid`)));
--
-- Structure de la vue `tx_nG6_view_project_run`
--
CREATE ALGORITHM=UNDEFINED DEFINER=`typo3`@`localhost` SQL SECURITY DEFINER VIEW `tx_nG6_view_project_run` AS select `tx_nG6_project`.`uid` AS `project_id`,`tx_nG6_project`.`name` AS `project_name`,`tx_nG6_run`.`uid` AS `run_id`,`tx_nG6_run`.`storage_size` AS `storage_size`,`tx_nG6_run`.`purged_size` AS `purged_size`,`tx_nG6_run`.`data_state` AS `state`,`tx_nG6_run`.`retention_date` AS `retention_date`,`tx_nG6_run`.`purge_demand_id` AS `purge_demand_id` from ((`tx_nG6_run` join `tx_nG6_project_run` on((`tx_nG6_project_run`.`run_id` = `tx_nG6_run`.`uid`))) join `tx_nG6_project` on((`tx_nG6_project`.`uid` = `tx_nG6_project_run`.`project_id`)));
--
-- Structure de la vue `tx_nG6_view_project_run_analyze`
--
CREATE ALGORITHM=UNDEFINED DEFINER=`typo3`@`localhost` SQL SECURITY DEFINER VIEW `tx_nG6_view_project_run_analyze` AS select `tx_nG6_project`.`uid` AS `project_id`,`tx_nG6_project`.`name` AS `project_name`,`tx_nG6_analyze`.`uid` AS `analyze_id`,`tx_nG6_analyze`.`storage_size` AS `storage_size`,`tx_nG6_analyze`.`purged_size` AS `purged_size`,`tx_nG6_analyze`.`data_state` AS `state`,`tx_nG6_analyze`.`retention_date` AS `retention_date`,`tx_nG6_analyze`.`purge_demand_id` AS `purge_demand_id` from ((((`tx_nG6_run` join `tx_nG6_project_run` on((`tx_nG6_project_run`.`run_id` = `tx_nG6_run`.`uid`))) join `tx_nG6_project` on((`tx_nG6_project`.`uid` = `tx_nG6_project_run`.`project_id`))) join `tx_nG6_run_analyze` on((`tx_nG6_run_analyze`.`run_id` = `tx_nG6_run`.`uid`))) join `tx_nG6_analyze` on((`tx_nG6_run_analyze`.`analyze_id` = `tx_nG6_analyze`.`uid`)));
--
-- Structure de la vue `tx_nG6_view_project_user`
--
CREATE ALGORITHM=UNDEFINED DEFINER=`typo3`@`localhost` SQL SECURITY DEFINER VIEW `tx_nG6_view_project_user` AS select `tx_nG6_project`.`uid` AS `project_id`,`fe_users`.`username` AS `user_name`,`fe_users`.`email` AS `email`,`fe_users`.`usergroup` AS `user_group`,`fe_rights_levels`.`right_level_label` AS `right_level_label`,`fe_groups`.`title` AS `user_group_title` from ((((`tx_nG6_project` join `fe_rights` on((`fe_rights`.`project_id` = `tx_nG6_project`.`uid`))) join `fe_users` on((`fe_rights`.`fe_user_id` = `fe_users`.`uid`))) join `fe_groups` on((`fe_users`.`usergroup` = `fe_groups`.`uid`))) join `fe_rights_levels` on((`fe_rights_levels`.`right_level_id` = `fe_rights`.`right_id`)));
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
......
......@@ -105,6 +105,13 @@ if __name__ == '__main__':
f.write("$TYPO3_CONF_VARS['BE']['disable_exec_function'] = '0';\n")
f.write("$TYPO3_CONF_VARS['GFX']['gdlib_png'] = '0';\n")
f.write("$TYPO3_CONF_VARS['GFX']['im_combine_filename'] = 'composite';\n")
f.write("$TYPO3_CONF_VARS['GFX']['im_combine_filename'] = 'composite';\n")
f.write("$TYPO3_CONF_VARS['EXT']['extConf']['ng6']['email_from'] = '" + args["email"] + "';\n")
f.write("$TYPO3_CONF_VARS['EXT']['extConf']['ng6']['delay_purge'] = '" + ng6reader.get('email', 'delay_purge') + "';\n")
f.write("$TYPO3_CONF_VARS['EXT']['extConf']['ng6']['min_extension_duration'] = '" + ng6reader.get('email', 'min_extension_duration') + "';\n")
f.write("$TYPO3_CONF_VARS['EXT']['extConf']['ng6']['min_extension_size'] = '" + ng6reader.get('email', 'min_extension_size') + "';\n")
f.write("$TYPO3_CONF_VARS['EXT']['extConf']['ng6']['min_extension_price'] = '" + ng6reader.get('email', 'min_extension_price') + "';\n")
# Typo3 password hash
random=uuid.uuid4().hex[:10]
install_tool_password_hash = hashlib.md5(random.encode('utf-8')).hexdigest()
......@@ -149,7 +156,7 @@ if __name__ == '__main__':
erase = input('The database already contains a ng6 web site, do you want to DROP it (y/n) ? ')
elif len(tables) > 0 and ("tt_content" in tables and "pages" in tables and "be_users" in tables ):
erase = input('The database already contains a ng6 web site, do you want to DROP it (y/n) ? ')
if erase == "y" :
if erase == "y" or erase == "Y" :
curs.execute("Drop table "+ ",".join(tables) +";")
curs.execute("".join(database))
connection.commit()
......
......@@ -96,11 +96,7 @@ class tx_nG6_pi6 extends tslib_pibase {
$smarty->assign('distribution', $distribution);
$smarty->assign('ng6_admin_users', tx_nG6_db::get_ng6_admin_users() );
//$this->projects_obsolete=tx_nG6_db::select_obsolete_list_retention_data_info();
//$smarty->assign('ng6_purge_projects',$this->projects_obsolete);
//$this->ng6_purge_demands=tx_nG6_db::get_purge_demand_list();
$smarty->assign('ng6_purge_delay',$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ng6']['delay_purge']);
//$smarty->assign('ng6_purge_demands',$this->ng6_purge_demands);
$smarty->assign('ng6_purge_delay',$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ng6']['delay_purge']);
$txNG6Utils = new tx_nG6_utils;
$smarty->assign_by_ref('tx_nG6_utils', $txNG6Utils);
return $smarty->fetch('administration_view.tpl');
......@@ -187,14 +183,14 @@ nG6 team';
$to = $purge_email_to;
$subject = '[nG6 purge] No '.$purge_demand_id.' - Project '.$p[$project_id]["project_name"];
$headers[] = 'From: '.$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ng6']['purge_email_from'];
#$headers[] = 'Cc: '.$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ng6']['purge_email_from'];
$headers[] = 'Reply-To: '.$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ng6']['purge_email_from'];
$headers[] = 'From: '.$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ng6']['email_from'];
#$headers[] = 'Cc: '.$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ng6']['email_from'];
$headers[] = 'Reply-To: '.$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ng6']['email_from'];
$headers[] = 'X-Mailer: PHP/' . phpversion();
#TODO Uncomment
#mail($to, $subject, $mail, implode("\r\n", $headers));
//return $headers ;
}
}
return $mail;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment