[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [982] branches/1.2



Revision: 982
          http://svn.sourceforge.net/ledger-smb/?rev=982&view=rev
Author:   tetragon
Date:     2007-03-22 12:02:31 -0700 (Thu, 22 Mar 2007)

Log Message:
-----------
Removing delete_dataset

Modified Paths:
--------------
    branches/1.2/LedgerSMB/User.pm
    branches/1.2/bin/admin.pl

Modified: branches/1.2/LedgerSMB/User.pm
===================================================================
--- branches/1.2/LedgerSMB/User.pm	2007-03-22 05:05:24 UTC (rev 981)
+++ branches/1.2/LedgerSMB/User.pm	2007-03-22 19:02:31 UTC (rev 982)
@@ -451,60 +451,6 @@
 }
   
 
-
-sub dbdelete {
-	my ($self, $form) = @_;
-
-	$form->{sid} = $form->{dbdefault};
-	&dbconnect_vars($form, $form->{dbdefault});
-	my $dbh = DBI->connect(
-		$form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) 
-			or $form->dberror(__FILE__.':'.__LINE__);
-	my $query = qq|DROP DATABASE "$form->{db}"|;
-	$dbh->do($query) || $form->dberror(__FILE__.':'.__LINE__.$query);
-
-	$dbh->disconnect;
-
-}
-  
-
-
-sub dbsources_unused {
-	my ($self, $form, $memfile) = @_;
-
-	my @dbexcl = ();
-	my @dbsources = ();
-  
-	$form->error(__FILE__.':'.__LINE__.": $memfile locked!") if (-f "${memfile}.LCK");
-  
-	# open members file
-	open(FH, '<', "$memfile") or $form->error(__FILE__.':'.__LINE__.": $memfile : $!");
-
-	while (<FH>) {
-		if (/^dbname=/) {
-			my ($null,$item) = split /=/;
-			push @dbexcl, $item;
-		}
-	}
-
-	close FH;
-
-	$form->{only_acc_db} = 1;
-	my @db = &dbsources("", $form);
-
-	push @dbexcl, $form->{dbdefault};
-
-	foreach $item (@db) {
-		unless (grep /$item$/, @dbexcl) {
-			push @dbsources, $item;
-		}
-	}
-
-	return @dbsources;
-
-}
-
-
 sub dbneedsupdate {
 	my ($self, $form) = @_;
 

Modified: branches/1.2/bin/admin.pl
===================================================================
--- branches/1.2/bin/admin.pl	2007-03-22 05:05:24 UTC (rev 981)
+++ branches/1.2/bin/admin.pl	2007-03-22 19:02:31 UTC (rev 982)
@@ -1046,7 +1046,6 @@
 	<input type="hidden" name="path" value="$form->{path}" />
 	<br />
 	<button type="submit" class="submit" name="action" value="create_dataset">|.$locale->text('Create Dataset').qq|</button>
-	<button type="submit" class="submit" name="action" value="delete_dataset">|.$locale->text('Delete Dataset').qq|</button>
 	</form>
 	<p>|.$locale->text('This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!')
 	.qq|</p>
@@ -1190,95 +1189,6 @@
 }
 
 
-sub delete_dataset {
-
-	if (@dbsources = LedgerSMB::User->dbsources_unused(\%$form)) {
-
-		foreach $item (sort @dbsources) {
-			$dbsources .= qq|<input name="db" class="radio" type="radio" value="$item" />&nbsp;$item |;
-		}
-
-	} else {
-		$form->error(__FILE__.':'.__LINE__.': '.$locale->text('Nothing to delete!'));
-	}
-
-	$form->{title} = "LedgerSMB ".$locale->text('Accounting')
-					." ".$locale->text('Database Administration')
-					." / ".$locale->text('Delete Dataset');
-
-	$form->{login} = "admin";
-	$form->header;
-
-	print qq|
-	<body class="admin">
-	<h2>$form->{title}</h2>
-	<form method="post" action="$form->{script}" />
-	<input type="hidden" name="dbdriver" value="$form->{dbdriver}" />
-	<input type="hidden" name="dbuser" value="$form->{dbuser}" />
-	<input type="hidden" name="dbhost" value="$form->{dbhost}" />
-	<input type="hidden" name="dbport" value="$form->{dbport}" />
-	<input type="hidden" name="dbpasswd" value="$form->{dbpasswd}" />
-	<input type="hidden" name="dbdefault" value="$form->{dbdefault}" />
-	<input name=callback type="hidden" value="$form->{script}?action=list_users&amp;path=$form->{path}">
-	<input type="hidden" name="path" value="$form->{path}" />
-	<input type="hidden" name="nextsub" value="dbdelete" />
-	<table width="100%">
-		<tr class="listheading">
-			<th>|.$locale->text('The following Datasets are not in use and can be deleted').qq|</th>
-		</tr>
-		<tr>
-			<td>
-			$dbsources
-			</td>
-		</tr>
-		<tr>
-			<td>
-				<hr size="3" noshade />
-				<br />
-				<button type="submit" class="submit" name="action" value="continue">|.$locale->text('Continue').qq|</button>
-			</td>
-		</tr>
-	</table>
-	</form>
-	</body>
-	</html>
-	|;
-
-}
-
-
-sub dbdelete {
-
-	if (!$form->{db}) {
-		$form->error(__FILE__.':'.__LINE__.': '.$locale->text('No Dataset selected!'));
-	}
-
-	LedgerSMB::User->dbdelete(\%$form);
-
-	$form->{title} = "LedgerSMB ".$locale->text('Accounting')
-					." ".$locale->text('Database Administration')
-					." / ".$locale->text('Delete Dataset');
-
-	$form->{login} = "admin";
-	$form->header;
-
-	print qq|
-	<body class="admin">
-	<center>
-	<h2>$form->{title}</h2>
-	$form->{db} |.$locale->text('successfully deleted!')
-	.qq|
-	<form method="post" action="$form->{script}" />
-	<input type="hidden" name="path" value="$form->{path}" />
-	<input type="hidden" name="nextsub" value="list_users" />
-	<p><button type="submit" class="submit" name="action" value="continue">|.$locale->text('Continue').qq|</button></p>
-	</form>
-	</body>
-	</html>
-	|;
-}
-
-
 sub unlock_system {
 
 	# This needs to be done with a db tool


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.