adding guid stuff
This commit is contained in:
parent
78c3a63fc0
commit
08f3fc841a
3 changed files with 17 additions and 13 deletions
|
|
@ -253,5 +253,8 @@ alter table userSession change sessionId sessionId char(22) not null;
|
||||||
alter table userSessionScratch change sessionId sessionId char(22) not null;
|
alter table userSessionScratch change sessionId sessionId char(22) not null;
|
||||||
alter table users change referringAffiliate referringAffiliate char(22) not null;
|
alter table users change referringAffiliate referringAffiliate char(22) not null;
|
||||||
|
|
||||||
|
delete from incrementer where incrementerId in ("databaseLinkId", "DataForm_entryId", "DataForm_fieldId", "DataForm_tabId", "EventsCalendar_eventId", "EventsCalendar_recurringId", "FileManager_fileId", "forumId", "forumPostId", "forumThreadId", "groupId", "languageId", "Product_benefitId", "Product_featureId", "Product_specificationId", "replacementId", "Survey_answerId", "Survey_id", "Survey_questionId", "Survey_responseId", "USS_id", "USS_submissionId", "wobjectId");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ A valid databaseLinkId
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub get {
|
sub get {
|
||||||
return WebGUI::SQL->quickHash("select * from databaseLink where databaseLinkId=".$_[0]);
|
return WebGUI::SQL->quickHash("select * from databaseLink where databaseLinkId=".quote($_[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -98,7 +98,7 @@ A valid databaseLinkId
|
||||||
sub whatIsUsing {
|
sub whatIsUsing {
|
||||||
# get list of SQLReports
|
# get list of SQLReports
|
||||||
my $sql = 'select wobject.wobjectId, wobject.title, page.menuTitle, page.urlizedTitle from wobject, SQLReport, page '.
|
my $sql = 'select wobject.wobjectId, wobject.title, page.menuTitle, page.urlizedTitle from wobject, SQLReport, page '.
|
||||||
'where SQLReport.databaseLinkId = '.$_[0].' and SQLReport.wobjectId = wobject.wobjectId '.
|
'where SQLReport.databaseLinkId = '.quote($_[0]). 'and SQLReport.wobjectId = wobject.wobjectId '.
|
||||||
'and wobject.pageId = page.pageId';
|
'and wobject.pageId = page.pageId';
|
||||||
my $sth = WebGUI::SQL->read($sql);
|
my $sth = WebGUI::SQL->read($sql);
|
||||||
my @using;
|
my @using;
|
||||||
|
|
@ -108,7 +108,7 @@ sub whatIsUsing {
|
||||||
$sth->finish;
|
$sth->finish;
|
||||||
|
|
||||||
# get list of groups
|
# get list of groups
|
||||||
$sql = 'select groupId, groupName from groups where databaseLinkId = '.$_[0];
|
$sql = 'select groupId, groupName from groups where databaseLinkId = '.quote($_[0]);
|
||||||
$sth = WebGUI::SQL->read($sql);
|
$sth = WebGUI::SQL->read($sql);
|
||||||
while (my $data = $sth->hashRef()) {
|
while (my $data = $sth->hashRef()) {
|
||||||
push @using, $data;
|
push @using, $data;
|
||||||
|
|
@ -203,7 +203,7 @@ sub new {
|
||||||
title=>"WebGUI Database"
|
title=>"WebGUI Database"
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
%databaseLink = WebGUI::SQL->quickHash("select * from databaseLink where databaseLinkId='$databaseLinkId'");
|
%databaseLink = WebGUI::SQL->quickHash("select * from databaseLink where databaseLinkId=".quote($databaseLinkId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bless {_databaseLinkId => $databaseLinkId, _databaseLink => \%databaseLink }, $class;
|
bless {_databaseLinkId => $databaseLinkId, _databaseLink => \%databaseLink }, $class;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ use Tie::CPHash;
|
||||||
use WebGUI::DatabaseLink;
|
use WebGUI::DatabaseLink;
|
||||||
use WebGUI::Grouping;
|
use WebGUI::Grouping;
|
||||||
use WebGUI::Icon;
|
use WebGUI::Icon;
|
||||||
|
use WebGUI::Id;
|
||||||
use WebGUI::International;
|
use WebGUI::International;
|
||||||
use WebGUI::Operation::Shared;
|
use WebGUI::Operation::Shared;
|
||||||
use WebGUI::Paginator;
|
use WebGUI::Paginator;
|
||||||
|
|
@ -47,9 +48,9 @@ sub www_copyDatabaseLink {
|
||||||
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(3));
|
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(3));
|
||||||
my (%db);
|
my (%db);
|
||||||
tie %db, 'Tie::CPHash';
|
tie %db, 'Tie::CPHash';
|
||||||
%db = WebGUI::SQL->quickHash("select * from databaseLink where databaseLinkId=$session{form}{dlid}");
|
%db = WebGUI::SQL->quickHash("select * from databaseLink where databaseLinkId=".quote($session{form}{dlid}));
|
||||||
WebGUI::SQL->write("insert into databaseLink (databaseLinkId,title,DSN,username,identifier) values (".getNextId("databaseLinkId").",
|
WebGUI::SQL->write("insert into databaseLink (databaseLinkId,title,DSN,username,identifier) values (".quote(WebGUI::Id::generate()).",
|
||||||
".quote('Copy of '.$db{title}).", ".quote($db{DSN}).", ".quote($db{username}).", ".quote($db{identifier}).")");
|
".quote($db{title}." (copy)").", ".quote($db{DSN}).", ".quote($db{username}).", ".quote($db{identifier}).")");
|
||||||
return www_listDatabaseLinks();
|
return www_listDatabaseLinks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,7 +80,7 @@ sub www_deleteDatabaseLink {
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_deleteDatabaseLinkConfirm {
|
sub www_deleteDatabaseLinkConfirm {
|
||||||
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(3));
|
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(3));
|
||||||
WebGUI::SQL->write("delete from databaseLink where databaseLinkId=".$session{form}{dlid});
|
WebGUI::SQL->write("delete from databaseLink where databaseLinkId=".quote($session{form}{dlid}));
|
||||||
return www_listDatabaseLinks();
|
return www_listDatabaseLinks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -91,7 +92,7 @@ sub www_editDatabaseLink {
|
||||||
if ($session{form}{dlid} eq "new") {
|
if ($session{form}{dlid} eq "new") {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
%db = WebGUI::SQL->quickHash("select * from databaseLink where databaseLinkId=$session{form}{dlid}");
|
%db = WebGUI::SQL->quickHash("select * from databaseLink where databaseLinkId=".quote($session{form}{dlid}));
|
||||||
}
|
}
|
||||||
$output .= helpIcon("database link add/edit");
|
$output .= helpIcon("database link add/edit");
|
||||||
$output .= '<h1>'.WebGUI::International::get(990).'</h1>';
|
$output .= '<h1>'.WebGUI::International::get(990).'</h1>';
|
||||||
|
|
@ -102,7 +103,7 @@ sub www_editDatabaseLink {
|
||||||
$f->text("title",WebGUI::International::get(992),$db{title});
|
$f->text("title",WebGUI::International::get(992),$db{title});
|
||||||
$f->text("DSN",WebGUI::International::get(993),$db{DSN});
|
$f->text("DSN",WebGUI::International::get(993),$db{DSN});
|
||||||
$f->text("username",WebGUI::International::get(994),$db{username});
|
$f->text("username",WebGUI::International::get(994),$db{username});
|
||||||
$f->text("identifier",WebGUI::International::get(995),$db{identifier});
|
$f->password("identifier",WebGUI::International::get(995),$db{identifier});
|
||||||
$f->submit;
|
$f->submit;
|
||||||
$output .= $f->print;
|
$output .= $f->print;
|
||||||
return _submenu($output);
|
return _submenu($output);
|
||||||
|
|
@ -112,11 +113,11 @@ sub www_editDatabaseLink {
|
||||||
sub www_editDatabaseLinkSave {
|
sub www_editDatabaseLinkSave {
|
||||||
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(3));
|
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(3));
|
||||||
if ($session{form}{dlid} eq "new") {
|
if ($session{form}{dlid} eq "new") {
|
||||||
$session{form}{dlid} = getNextId("databaseLinkId");
|
$session{form}{dlid} = WebGUI::Id::generate();
|
||||||
WebGUI::SQL->write("insert into databaseLink (databaseLinkId) values ($session{form}{dlid})");
|
WebGUI::SQL->write("insert into databaseLink (databaseLinkId) values (".quote($session{form}{dlid}).")");
|
||||||
}
|
}
|
||||||
WebGUI::SQL->write("update databaseLink set title=".quote($session{form}{title}).", DSN=".quote($session{form}{DSN}).",
|
WebGUI::SQL->write("update databaseLink set title=".quote($session{form}{title}).", DSN=".quote($session{form}{DSN}).",
|
||||||
username=".quote($session{form}{username}).", identifier=".quote($session{form}{identifier})." where databaseLinkId=".$session{form}{dlid});
|
username=".quote($session{form}{username}).", identifier=".quote($session{form}{identifier})." where databaseLinkId=".quote($session{form}{dlid}));
|
||||||
return www_listDatabaseLinks();
|
return www_listDatabaseLinks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue