AntonLV 9 年之前
父節點
當前提交
f2d4d693d8

+ 2 - 0
install/sql/system.sql

@@ -2700,6 +2700,7 @@ INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `c
 ('sys_account', 'system', 'name', '', '', 0, 'text', '_sys_form_login_input_caption_system_name', '_sys_form_account_input_name', '', 1, 0, 0, '', '', '', 'Avail', '', '_sys_form_account_input_name_error', 'Xss', '', 0, 0),
 ('sys_account', 'system', 'captcha', '', '', 0, 'captcha', '_sys_form_login_input_caption_system_captcha', '_sys_form_account_input_captcha', '', 1, 0, 0, '', '', '', 'Captcha', '', '_sys_form_account_input_captcha_error', '', '', 1, 0),
 ('sys_account', 'system', 'password_current', '', '', 0, 'password', '_sys_form_login_input_caption_system_password_current', '_sys_form_account_input_password_current', '', 1, 0, 0, '', '', '', 'PasswordCurrent', '', '_sys_form_account_input_password_current_error', '', '', 0, 0),
+('sys_account', 'system', 'delete_content', '0', '', 0, 'hidden', '_sys_form_login_input_caption_system_delete_content', '', '', 1, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
 ('sys_account', 'system', 'delete_confirm', '1', '', 0, 'checkbox', '_sys_form_login_input_caption_system_delete_confirm', '_sys_form_account_input_delete_confirm', '_sys_form_account_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_sys_form_account_input_delete_confirm_error', '', '', 0, 0),
 ('sys_account', 'system', 'receive_updates', '1', '', 1, 'switcher', '_sys_form_login_input_caption_system_receive_updates', '_sys_form_account_input_receive_updates', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
 ('sys_account', 'system', 'receive_news', '1', '', 1, 'switcher', '_sys_form_login_input_caption_system_receive_news', '_sys_form_account_input_receive_news', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
@@ -2775,6 +2776,7 @@ INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_fo
 ('sys_account_settings_pwd', 'password_confirm', 2147483647, 1, 3),
 ('sys_account_settings_pwd', 'do_submit', 2147483647, 1, 4),
 
+('sys_account_settings_del_account', 'delete_content', 2147483647, 1, 0),
 ('sys_account_settings_del_account', 'delete_confirm', 2147483647, 1, 1),
 ('sys_account_settings_del_account', 'password_current', 2147483647, 1, 2),
 ('sys_account_settings_del_account', 'do_submit', 2147483647, 1, 3),

+ 1 - 0
modules/boonex/english/data/langs/system/en.xml

@@ -1873,6 +1873,7 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_form_login_input_caption_system_agreement"><![CDATA[Agreement]]></string>
 	<string name="_sys_form_login_input_caption_system_captcha"><![CDATA[Captcha]]></string>
 	<string name="_sys_form_login_input_caption_system_delete_confirm"><![CDATA[Confirm Delete]]></string>
+	<string name="_sys_form_login_input_caption_system_delete_content"><![CDATA[Delete with Content]]></string>
 	<string name="_sys_form_login_input_caption_system_do_submit"><![CDATA[Sign up]]></string>
 	<string name="_sys_form_login_input_caption_system_email"><![CDATA[Email]]></string>
 	<string name="_sys_form_login_input_caption_system_id"><![CDATA[ID]]></string>

+ 2 - 0
modules/boonex/organizations/install/langs/en.xml

@@ -148,6 +148,8 @@
     <string name="_bx_orgs_menu_item_title_delete_profile"><![CDATA[Delete Profile]]></string>
     <string name="_bx_orgs_menu_item_title_system_delete_account"><![CDATA[Delete Account]]></string>
     <string name="_bx_orgs_menu_item_title_delete_account"><![CDATA[Delete Account]]></string>
+    <string name="_bx_orgs_menu_item_title_system_delete_account_content"><![CDATA[Delete Account with Content]]></string>
+    <string name="_bx_orgs_menu_item_title_delete_account_content"><![CDATA[Delete Account with Content]]></string>
     <string name="_bx_orgs_menu_item_title_system_profile_type"><![CDATA[Organization]]></string>
     <string name="_bx_orgs_menu_item_title_profile_type"><![CDATA[Organization]]></string>
     <string name="_bx_orgs_menu_item_title_system_create_profile"><![CDATA[Organization]]></string>

+ 2 - 1
modules/boonex/organizations/install/sql/enable.sql

@@ -216,7 +216,8 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 ('bx_organizations_view_actions_more', 'bx_organizations', 'edit-organization-cover', '_bx_orgs_menu_item_title_system_edit_cover', '_bx_orgs_menu_item_title_edit_cover', 'page.php?i=edit-organization-cover&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 25),
 ('bx_organizations_view_actions_more', 'bx_organizations', 'edit-organization-profile', '_bx_orgs_menu_item_title_system_edit_profile', '_bx_orgs_menu_item_title_edit_profile', 'page.php?i=edit-organization-profile&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 30),
 ('bx_organizations_view_actions_more', 'bx_organizations', 'delete-organization-profile', '_bx_orgs_menu_item_title_system_delete_profile', '_bx_orgs_menu_item_title_delete_profile', 'page.php?i=delete-organization-profile&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 40),
-('bx_organizations_view_actions_more', 'bx_organizations', 'delete-organization-account', '_bx_orgs_menu_item_title_system_delete_account', '_bx_orgs_menu_item_title_delete_account', 'page.php?i=account-settings-delete&id={account_id}', '', '', 'remove', '', 128, 1, 0, 50);
+('bx_organizations_view_actions_more', 'bx_organizations', 'delete-organization-account', '_bx_orgs_menu_item_title_system_delete_account', '_bx_orgs_menu_item_title_delete_account', 'page.php?i=account-settings-delete&id={account_id}', '', '', 'remove', '', 128, 1, 0, 50),
+('bx_organizations_view_actions_more', 'bx_organizations', 'delete-organization-account-content', '_bx_orgs_menu_item_title_system_delete_account_content', '_bx_orgs_menu_item_title_delete_account_content', 'page.php?i=account-settings-delete&id={account_id}&content=1', '', '', 'remove', '', 128, 1, 0, 60);
 
 -- MENU: module sub-menu
 

+ 2 - 0
modules/boonex/persons/install/langs/en.xml

@@ -145,6 +145,8 @@
     <string name="_bx_persons_menu_item_title_delete_profile"><![CDATA[Delete Profile]]></string>
     <string name="_bx_persons_menu_item_title_system_delete_account"><![CDATA[Delete Account]]></string>
     <string name="_bx_persons_menu_item_title_delete_account"><![CDATA[Delete Account]]></string>
+    <string name="_bx_persons_menu_item_title_system_delete_account_content"><![CDATA[Delete Account with Content]]></string>
+    <string name="_bx_persons_menu_item_title_delete_account_content"><![CDATA[Delete Account with Content]]></string>
     <string name="_bx_persons_menu_item_title_system_profile_type"><![CDATA[Person]]></string>
     <string name="_bx_persons_menu_item_title_profile_type"><![CDATA[Person]]></string>
     <string name="_bx_persons_menu_item_title_system_create_profile"><![CDATA[Person]]></string>

+ 2 - 1
modules/boonex/persons/install/sql/enable.sql

@@ -205,7 +205,8 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 ('bx_persons_view_actions_more', 'bx_persons', 'edit-persons-cover', '_bx_persons_menu_item_title_system_edit_cover', '_bx_persons_menu_item_title_edit_cover', 'page.php?i=edit-persons-cover&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 25),
 ('bx_persons_view_actions_more', 'bx_persons', 'edit-persons-profile', '_bx_persons_menu_item_title_system_edit_profile', '_bx_persons_menu_item_title_edit_profile', 'page.php?i=edit-persons-profile&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 30),
 ('bx_persons_view_actions_more', 'bx_persons', 'delete-persons-profile', '_bx_persons_menu_item_title_system_delete_profile', '_bx_persons_menu_item_title_delete_profile', 'page.php?i=delete-persons-profile&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 40),
-('bx_persons_view_actions_more', 'bx_persons', 'delete-persons-account', '_bx_persons_menu_item_title_system_delete_account', '_bx_persons_menu_item_title_delete_account', 'page.php?i=account-settings-delete&id={account_id}', '', '', 'remove', '', 128, 1, 0, 50);
+('bx_persons_view_actions_more', 'bx_persons', 'delete-persons-account', '_bx_persons_menu_item_title_system_delete_account', '_bx_persons_menu_item_title_delete_account', 'page.php?i=account-settings-delete&id={account_id}', '', '', 'remove', '', 128, 1, 0, 50),
+('bx_persons_view_actions_more', 'bx_persons', 'delete-persons-account-content', '_bx_persons_menu_item_title_system_delete_account_content', '_bx_persons_menu_item_title_delete_account_content', 'page.php?i=account-settings-delete&id={account_id}&content=1', '', '', 'remove', '', 128, 1, 0, 60);
 
 -- MENU: module sub-menu
 

+ 2 - 0
modules/boonex/russian/data/langs/bx_organizations/ru.xml

@@ -148,6 +148,8 @@
     <string name="_bx_orgs_menu_item_title_delete_profile"><![CDATA[Удалить профиль]]></string>
     <string name="_bx_orgs_menu_item_title_system_delete_account"><![CDATA[Удалить аккаунт]]></string>
     <string name="_bx_orgs_menu_item_title_delete_account"><![CDATA[Удалить аккаунт]]></string>
+    <string name="_bx_orgs_menu_item_title_system_delete_account_content"><![CDATA[Удалить аккаунт и контент]]></string>
+    <string name="_bx_orgs_menu_item_title_delete_account_content"><![CDATA[Удалить аккаунт и контент]]></string>
     <string name="_bx_orgs_menu_item_title_system_profile_type"><![CDATA[Организация]]></string>
     <string name="_bx_orgs_menu_item_title_profile_type"><![CDATA[Организация]]></string>
     <string name="_bx_orgs_menu_item_title_system_create_profile"><![CDATA[Организация]]></string>

+ 2 - 0
modules/boonex/russian/data/langs/bx_persons/ru.xml

@@ -145,6 +145,8 @@
     <string name="_bx_persons_menu_item_title_delete_profile"><![CDATA[Удалить профиль]]></string>
     <string name="_bx_persons_menu_item_title_system_delete_account"><![CDATA[Удалить аккаунт]]></string>
     <string name="_bx_persons_menu_item_title_delete_account"><![CDATA[Удалить аккаунт]]></string>
+    <string name="_bx_persons_menu_item_title_system_delete_account_content"><![CDATA[Удалить аккаунт и контент]]></string>
+    <string name="_bx_persons_menu_item_title_delete_account_content"><![CDATA[Удалить аккаунт и контент]]></string>
     <string name="_bx_persons_menu_item_title_system_profile_type"><![CDATA[Персона]]></string>
     <string name="_bx_persons_menu_item_title_profile_type"><![CDATA[Персона]]></string>
     <string name="_bx_persons_menu_item_title_system_create_profile"><![CDATA[Персона]]></string>

+ 1 - 0
modules/boonex/russian/data/langs/system/ru.xml

@@ -1871,6 +1871,7 @@
 	<string name="_sys_form_login_input_caption_system_agreement"><![CDATA[Соглашение]]></string>
 	<string name="_sys_form_login_input_caption_system_captcha"><![CDATA[Капча]]></string>
 	<string name="_sys_form_login_input_caption_system_delete_confirm"><![CDATA[Подтвердить Удаление]]></string>
+	<string name="_sys_form_login_input_caption_system_delete_content"><![CDATA[Удалить с контентом]]></string>
 	<string name="_sys_form_login_input_caption_system_do_submit"><![CDATA[Присоединиться]]></string>
 	<string name="_sys_form_login_input_caption_system_email"><![CDATA[Имейл]]></string>
 	<string name="_sys_form_login_input_caption_system_id"><![CDATA[ID]]></string>

+ 4 - 1
template/scripts/BxBaseAccountForms.php

@@ -161,6 +161,9 @@ class BxBaseAccountForms extends BxDolProfileForms
 
         // check and display form
         $oForm = $this->getObjectFormDelete();
+        if(bx_get('content') !== false)
+            $oForm->aInputs['delete_content']['value'] = (int)bx_get('content');
+
         if (!$oForm)
             return MsgBox(_t('_sys_txt_error_occured'));
 
@@ -174,7 +177,7 @@ class BxBaseAccountForms extends BxDolProfileForms
 
         // delete account
         $oAccount = BxDolAccount::getInstance($aAccountInfo['id']);
-        if (!$oAccount->delete())
+        if (!$oAccount->delete((int)$oForm->getCleanValue('delete_content') != 0))
             return MsgBox(_t('_sys_txt_error_account_delete'));
 
         // logout from deleted account