[Slashdotjp-dev 755] [267] add "delete finished page"

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
2007年 11月 27日 (火) 15:20:41 JST


Revision: 267
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=267
Author:   caesar
Date:     2007-11-27 15:20:40 +0900 (Tue, 27 Nov 2007)

Log Message:
-----------
add "delete finished page"

Modified Paths:
--------------
    slashjp/branches/deluser/plugins/DelUser/PLUGIN
    slashjp/branches/deluser/plugins/DelUser/deluser.pl
    slashjp/branches/deluser/plugins/DelUser/templates/deleteUser;deluser;default

Added Paths:
-----------
    slashjp/branches/deluser/plugins/DelUser/templates/deleteUserFinished;deluser;default


-------------- next part --------------
Modified: slashjp/branches/deluser/plugins/DelUser/PLUGIN
===================================================================
--- slashjp/branches/deluser/plugins/DelUser/PLUGIN	2007-11-19 10:26:47 UTC (rev 266)
+++ slashjp/branches/deluser/plugins/DelUser/PLUGIN	2007-11-27 06:20:40 UTC (rev 267)
@@ -1,7 +1,5 @@
 name=DelUser
 description="User deletion plugin"
-#mysql_dump=mysql_dump
-#mysql_schema=mysql_schema
 htdoc=deluser.pl
-#task=get_translation_articles.pl
-template=templates/deleteUserForm;deluser;default
+template=templates/deleteUser;deluser;default
+template=templates/deleteUserFinished;deluser;default

Modified: slashjp/branches/deluser/plugins/DelUser/deluser.pl
===================================================================
--- slashjp/branches/deluser/plugins/DelUser/deluser.pl	2007-11-19 10:26:47 UTC (rev 266)
+++ slashjp/branches/deluser/plugins/DelUser/deluser.pl	2007-11-27 06:20:40 UTC (rev 267)
@@ -5,11 +5,7 @@
 # $Id: $
 
 use strict;
-#use Image::Size;
-#use POSIX qw(O_RDWR O_CREAT O_EXCL tmpnam);
-
 use utf8;
-
 use Slash;
 use Slash::Constants qw(:web :messages);
 use Slash::Display;
@@ -27,6 +23,7 @@
 	my $user_ok = !$user->{is_anon};
 	my $delete_ok = $form->{delete_ok};
 
+
 	my %ops = (
 	    deleteform => [$user_ok, \&deleteUserForm],
 	    deleteok => [$post_ok && $user_ok $$ $delete_ok, \&deleteUser],
@@ -38,8 +35,8 @@
 	    $form->{op} = $op = 'deleteform';
 	}
 
-	# if not logged in
-	if (!$user_ok) {
+	# if not logged in or you are admin
+	if (!$user_ok || $user->{seclev} < 2) {
 	    my $rootdir = getCurrentStatic('rootdir');
 	    redirect("$rootdir/");
 	}
@@ -61,12 +58,22 @@
     my($slashdb, $reader, $constants, $user, $form) = @_;
     my $uid = $user->{uid};
 
-    my $rows = $slashdb->deleteUser($uid);
-    if ($rows) {
-	my $rootdir = getCurrentStatic('rootdir');
-	redirect("$rootdir/my/logout");
+    if (!$form->{delete_ok}) {
+	my $note = '';
+	deleteUserForm(@_, $note);
+    } else {
+	my $rows = $slashdb->deleteUser($uid);
+	if ($rows) {
+	    $slashdb->deleteLogToken($uid);
+	    $uid = $constants->{anonymous_coward_uid};
+	    delete $cookies->{user};
+	    setCookie('user', '');
+
+	    header();
+	    slashDisplay('deleteUserFinished');
+	    footer();
+	}
     }
-#    deleteUserForm(@_, $note);
 }
 
 createEnvironment();

Modified: slashjp/branches/deluser/plugins/DelUser/templates/deleteUser;deluser;default
===================================================================
--- slashjp/branches/deluser/plugins/DelUser/templates/deleteUser;deluser;default	2007-11-19 10:26:47 UTC (rev 266)
+++ slashjp/branches/deluser/plugins/DelUser/templates/deleteUser;deluser;default	2007-11-27 06:20:40 UTC (rev 267)
@@ -9,14 +9,15 @@
 __lang__
 en_US
 __name__
-deleteUserForm
+deleteUser
 __template__
 <div id="slashboxes">
         [% PROCESS userboxes %]
 </div>
 [% thisnickname = user.nickname | strip_literal;
-   title = "アカウント$thisnickname ($user.uid)を削除" %]
+   title = "アカウント $thisnickname ($user.uid)を削除" %]
 <div id="users-blocks">
+  [% PROCESS prefs_titlebar tab_selected='deluser' %]
   <div class="generalbody">
     <script language="JavaScript">
 // <!--
@@ -43,6 +44,7 @@
 	<legend></legend>
 	<input type="hidden" name="uid" value="[% user.uid %]">
 	<p>アカウントを削除する場合は,以下のチェックボックスにチェックを入れ送信ボタンを押してください。</p>
+	<p>この操作により,システムに登録されているあなたの個人情報や発言全てが削除されます。</p>
 	<div id="delete_ok_box">
 	  <label>
 	    <input id="delete_ok" type="checkbox" name="delete_ok" value="delete_ok" onClick="toggle_form(this.checked)" onKeydown="toggle_form(this.checked)">本当に削除する</label>

Added: slashjp/branches/deluser/plugins/DelUser/templates/deleteUserFinished;deluser;default
===================================================================
--- slashjp/branches/deluser/plugins/DelUser/templates/deleteUserFinished;deluser;default	2007-11-19 10:26:47 UTC (rev 266)
+++ slashjp/branches/deluser/plugins/DelUser/templates/deleteUserFinished;deluser;default	2007-11-27 06:20:40 UTC (rev 267)
@@ -0,0 +1,26 @@
+__section__
+default
+__description__
+Delete user finished
+__title__
+Delete user finished
+__page__
+deluser
+__lang__
+en_US
+__name__
+deleteUserFinished
+__template__
+<div id="slashboxes">
+        [% PROCESS userboxes %]
+</div>
+<div id="users-blocks">
+  <div class="generalbody">
+    [% INCLUDE titlebar title="アカウントの削除が完了しました" %]
+    <p>個人情報を含む,あなたに関係するデータはシステムから削除されました。Slashdot Japan をご利用いただきありがとうございました。</p>
+  </div>
+</div>
+__seclev__
+500
+__version__
+$Id: $


Slashdotjp-dev メーリングリストの案内
アーカイブの一覧に戻る