WebGUI 2.2.0 release
This commit is contained in:
parent
bd9cf300a1
commit
794b4a319c
23 changed files with 779 additions and 115 deletions
370
docs/create.sql
370
docs/create.sql
File diff suppressed because one or more lines are too long
7
docs/credits.txt
Normal file
7
docs/credits.txt
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
The following people/companies are responsible for WebGUI:
|
||||
|
||||
WebGUI Core...........................JT Smith / Plain Black Software
|
||||
German Translation....................Mattias Kunkel / WERU AG
|
||||
Perl..................................Larry Wall / O'Reilly
|
||||
Data::Config..........................Sébastien Aperghis-Tramoni
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
extras/copy.gif
Normal file
BIN
extras/copy.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 923 B |
|
|
@ -1,5 +1,5 @@
|
|||
package WebGUI;
|
||||
our $VERSION = "2.1.1";
|
||||
our $VERSION = "2.2.0";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -60,7 +60,7 @@ sub _displayAdminBar {
|
|||
$session{env}{SCRIPT_NAME}.'/clipboard'=>WebGUI::International::get(9),
|
||||
$session{env}{SCRIPT_NAME}.'/trash'=>WebGUI::International::get(10),
|
||||
$session{page}{url}.'?op=purgeTrash'=>WebGUI::International::get(11),
|
||||
$session{page}{url}.'?op=/viewStatistics'=>WebGUI::International::get(144)
|
||||
$session{page}{url}.'?op=viewStatistics'=>WebGUI::International::get(144)
|
||||
);
|
||||
}
|
||||
%hash = ( $session{page}{url}=>WebGUI::International::get(82),
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ sub _recurseCrumbTrail {
|
|||
$output .= _recurseCrumbTrail($data{parentId});
|
||||
}
|
||||
if ($data{title} ne "") {
|
||||
$output .= '<a href="'.$session{env}{SCRIPT_NAME}.'/'.$data{urlizedTitle}.'">'.$data{title}.'</a> > '
|
||||
$output .= '<a class="crumbTrail" href="'.$session{env}{SCRIPT_NAME}.'/'.$data{urlizedTitle}.'">'.$data{title}.'</a> > '
|
||||
;
|
||||
}
|
||||
return $output;
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@ sub process {
|
|||
$output = $_[0];
|
||||
#---home link---
|
||||
if ($output =~ /\^H(.*)\^\/H/) {
|
||||
$temp = '<a href="'.$session{env}{SCRIPT_NAME}.'/home">'.$1.'</a>';
|
||||
$temp = '<a class="homeLink" href="'.$session{env}{SCRIPT_NAME}.'/home">'.$1.'</a>';
|
||||
$output =~ s/\^H(.*)\^\/H/$temp/g;
|
||||
} elsif ($output =~ /\^H/) {
|
||||
$temp = '<a href="'.$session{env}{SCRIPT_NAME}.'/home">'.WebGUI::International::get(47).'</a>';
|
||||
$temp = '<a class="homeLink" href="'.$session{env}{SCRIPT_NAME}.'/home">'.WebGUI::International::get(47).'</a>';
|
||||
$output =~ s/\^H/$temp/g;
|
||||
}
|
||||
return $output;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ sub process {
|
|||
$temp .= WebGUI::International::get(48);
|
||||
$temp .= ' '.$session{user}{username}.'. ';
|
||||
$temp .= WebGUI::International::get(49);
|
||||
$temp = WebGUI::Macro::Backslash::process($temp);
|
||||
$temp = WebGUI::Macro::Backslash_pageUrl::process($temp);
|
||||
} else {
|
||||
$temp .= '<form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$temp .= WebGUI::Form::hidden("op","login").'<span class="formSubtext">';
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ sub traversePageTree {
|
|||
$sth = WebGUI::SQL->read("select urlizedTitle, title, pageId from page where parentId='$_[0]' order by sequenceNumber",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
if (WebGUI::Privilege::canViewPage($data[2])) {
|
||||
$output .= $depth.'<a href="'.$session{env}{SCRIPT_NAME}.'/'.$data[0].'">'.$data[1].'</a><br>';
|
||||
$output .= $depth.'<a class="verticalMenu" href="'.$session{env}{SCRIPT_NAME}.'/'.$data[0].'">'.$data[1].'</a><br>';
|
||||
$output .= traversePageTree($data[2],$_[1]+1,$_[2]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@ sub process {
|
|||
$output = $_[0];
|
||||
#---account link---
|
||||
if ($output =~ /\^a(.*)\^\/a/) {
|
||||
$temp = '<a href="'.$session{page}{url}.'?op=displayAccount">'.$1.'</a>';
|
||||
$temp = '<a class="myAccountLink" href="'.$session{page}{url}.'?op=displayAccount">'.$1.'</a>';
|
||||
$output =~ s/\^a(.*)\^\/a/$temp/g;
|
||||
} elsif ($output =~ /\^a/) {
|
||||
$temp = '<a href="'.$session{page}{url}.'?op=displayAccount">'.WebGUI::International::get(46).'</a>';
|
||||
$temp = '<a class="myAccountLink" href="'.$session{page}{url}.'?op=displayAccount">'.WebGUI::International::get(46).'</a>';
|
||||
$output =~ s/\^a/$temp/g;
|
||||
}
|
||||
return $output;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ sub process {
|
|||
} else {
|
||||
$temp .= " · ";
|
||||
}
|
||||
$temp .= '<a href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a>';
|
||||
$temp .= '<a class="horizontalMenu" href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a>';
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ sub process {
|
|||
} else {
|
||||
$temp .= " · ";
|
||||
}
|
||||
$temp .= '<a href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a>';
|
||||
$temp .= '<a class="horizontalMenu" href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a>';
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ sub process {
|
|||
} else {
|
||||
$temp .= '?makePrintable=1';
|
||||
}
|
||||
$temp = '<a href="'.$temp.'">'.$1.'</a>';
|
||||
$temp = '<a class="makePrintable" href="'.$temp.'">'.$1.'</a>';
|
||||
$output =~ s/\^r(.*)\^\/r/$temp/g;
|
||||
} elsif ($output =~ /\^r/) {
|
||||
$temp = $session{env}{REQUEST_URI};
|
||||
|
|
@ -35,7 +35,7 @@ sub process {
|
|||
} else {
|
||||
$temp .= '?makePrintable=1';
|
||||
}
|
||||
$temp = '<a href="'.$temp.'">';
|
||||
$temp = '<a class="makePrintable" href="'.$temp.'">';
|
||||
$temp .= WebGUI::International::get(53);
|
||||
$temp .= '</a>';
|
||||
$output =~ s/\^r/$temp/g;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ sub process {
|
|||
} else {
|
||||
$temp .= " · ";
|
||||
}
|
||||
$temp .= '<a href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a>';
|
||||
$temp .= '<a class="horizontalMenu" href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a>';
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ sub _login {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_createAccount {
|
||||
my ($output, %language);
|
||||
my ($output, %language, @array);
|
||||
if ($session{user}{userId} != 1) {
|
||||
$output .= www_displayAccount();
|
||||
} elsif ($session{setting}{anonymousRegistration} eq "no") {
|
||||
|
|
@ -75,7 +75,9 @@ sub www_createAccount {
|
|||
$output .= '<form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","saveAccount");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(50).'</td><td>'.WebGUI::Form::text("username",20,30).'</td></tr>';
|
||||
unless ($session{setting}{authMethod} eq "LDAP" && $session{setting}{usernameBinding} eq "yes") {
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(50).'</td><td>'.WebGUI::Form::text("username",20,30).'</td></tr>';
|
||||
}
|
||||
if ($session{setting}{authMethod} eq "LDAP") {
|
||||
$output .= WebGUI::Form::hidden("identifier1","ldap-password");
|
||||
$output .= WebGUI::Form::hidden("identifier2","ldap-password");
|
||||
|
|
@ -87,7 +89,8 @@ sub www_createAccount {
|
|||
}
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(56).'</td><td>'.WebGUI::Form::text("email",20,255).'<span class="formSubtext"><br>'.WebGUI::International::get(57).'</span></td></tr>';
|
||||
%language = WebGUI::SQL->buildHash("select distinct(language) from international",$session{dbh});
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(304).'</td><td>'.WebGUI::Form::selectList("language",\%language).'</td></tr>';
|
||||
$array[0] = "English";
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(304).'</td><td>'.WebGUI::Form::selectList("language",\%language,\@array).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table>';
|
||||
$output .= '</form> ';
|
||||
|
|
@ -134,9 +137,15 @@ sub www_displayAccount {
|
|||
$output .= '<form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","updateAccount");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(50).'</td><td>'.WebGUI::Form::text("username",20,30,$session{user}{username}).'</td></tr>';
|
||||
if ($session{user}{authMethod} eq "LDAP" && $session{setting}{usernameBinding} eq "yes") {
|
||||
$output .= WebGUI::Form::hidden("username",$session{user}{username});
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(50).'</td><td>'.$session{user}{username}.'</td></tr>';
|
||||
} else {
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(50).'</td><td>'.WebGUI::Form::text("username",20,30,$session{user}{username}).'</td></tr>';
|
||||
}
|
||||
if ($session{user}{authMethod} eq "LDAP") {
|
||||
$output .= WebGUI::Form::hidden("identifier","password");
|
||||
$output .= WebGUI::Form::hidden("identifier1","password");
|
||||
$output .= WebGUI::Form::hidden("identifier2","password");
|
||||
} else {
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(51).'</td><td>'.WebGUI::Form::password("identifier1",20,30,"password").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(55).'</td><td>'.WebGUI::Form::password("identifier2",20,30,"password").'</td></tr>';
|
||||
|
|
@ -204,8 +213,7 @@ sub www_login {
|
|||
}
|
||||
%args = (port => $port);
|
||||
$ldap = Net::LDAP->new($uri->host, %args) or $error = WebGUI::International::get(79);
|
||||
$auth = $ldap->bind($connectDN, $session{form}{identifier});
|
||||
$ldap->unbind;
|
||||
$auth = $ldap->bind(dn=>$connectDN, password=>$session{form}{identifier});
|
||||
if ($auth->code == 48 || $auth->code == 49) {
|
||||
$error = WebGUI::International::get(68);
|
||||
WebGUI::ErrorHandler::warn("Invalid login for user account: ".$session{form}{username});
|
||||
|
|
@ -216,6 +224,7 @@ sub www_login {
|
|||
} else {
|
||||
$success = 1;
|
||||
}
|
||||
$ldap->unbind;
|
||||
} else {
|
||||
if (Digest::MD5::md5_base64($session{form}{identifier}) eq $pass && $session{form}{identifier} ne "") {
|
||||
$success = 1;
|
||||
|
|
@ -235,7 +244,6 @@ sub www_login {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_logout {
|
||||
WebGUI::Session::end($session{var}{sessionId});
|
||||
#_login(1,"null");
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
@ -292,12 +300,17 @@ sub www_recoverPasswordFinish {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_saveAccount {
|
||||
my ($uri, $ldap, $port, %args, $search, $connectDN, $auth, $output, $error, $uid, $encryptedPassword);
|
||||
if (_hasBadUsername($session{form}{username})) {
|
||||
my ($username, $uri, $ldap, $port, %args, $search, $connectDN, $auth, $output, $error, $uid, $encryptedPassword);
|
||||
if ($session{setting}{authMethod} eq "LDAP" && $session{setting}{usernameBinding} eq "yes") {
|
||||
$username = $session{form}{ldapId};
|
||||
} else {
|
||||
$username = $session{form}{username};
|
||||
}
|
||||
if (_hasBadUsername($username)) {
|
||||
$error = WebGUI::International::get(77);
|
||||
$error .= ' "'.$session{form}{username}.'too", ';
|
||||
$error .= '"'.$session{form}{username}.'2", ';
|
||||
$error .= '"'.$session{form}{username}.'_'.WebGUI::DateTime::epochToHuman(time(),"%y").'"';
|
||||
$error .= ' "'.$username.'too", ';
|
||||
$error .= '"'.$username.'2", ';
|
||||
$error .= '"'.$username.'_'.WebGUI::DateTime::epochToHuman(time(),"%y").'"';
|
||||
$error .= '<p>';
|
||||
}
|
||||
if (_hasBadPassword($session{form}{identifier1},$session{form}{identifier2})) {
|
||||
|
|
@ -330,7 +343,7 @@ sub www_saveAccount {
|
|||
if ($error eq "") {
|
||||
$encryptedPassword = Digest::MD5::md5_base64($session{form}{identifier1});
|
||||
$uid = getNextId("userId");
|
||||
WebGUI::SQL->write("insert into users (userId,username,identifier,email,authMethod,ldapURL,connectDN,language) values ($uid, ".quote($session{form}{username}).", ".quote($encryptedPassword).", ".quote($session{form}{email}).", ".quote($session{setting}{authMethod}).", ".quote($session{setting}{ldapURL}).", ".quote($connectDN).", ".quote($session{form}{language}).")",$session{dbh});
|
||||
WebGUI::SQL->write("insert into users (userId,username,identifier,email,authMethod,ldapURL,connectDN,language) values ($uid, ".quote($username).", ".quote($encryptedPassword).", ".quote($session{form}{email}).", ".quote($session{setting}{authMethod}).", ".quote($session{setting}{ldapURL}).", ".quote($connectDN).", ".quote($session{form}{language}).")",$session{dbh});
|
||||
WebGUI::SQL->write("insert into groupings values (2,$uid)",$session{dbh});
|
||||
_login($uid,$encryptedPassword);
|
||||
$output .= WebGUI::International::get(80).'<p>';
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ sub www_addPage {
|
|||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,$session{form}{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(100).'</td><td>'.WebGUI::Form::textArea("metaTags",$session{form}{metaTags}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(307).'</td><td>'.WebGUI::Form::checkbox("defaultMetaTags",1,1).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
|
|
@ -83,7 +84,7 @@ sub www_addPageSave {
|
|||
while (($test) = WebGUI::SQL->quickArray("select urlizedTitle from page where urlizedTitle='$urlizedTitle'",$session{dbh})) {
|
||||
$urlizedTitle .= 2;
|
||||
}
|
||||
WebGUI::SQL->write("insert into page values (".getNextId("pageId").", $session{page}{pageId}, ".quote($session{form}{title}).", $session{page}{styleId}, $session{user}{userId}, $session{page}{ownerView}, $session{page}{ownerEdit}, $session{page}{groupId}, $session{page}{groupView}, $session{page}{groupEdit}, $session{page}{worldView}, $session{page}{worldEdit}, '$nextSeq', ".quote($session{form}{metaTags}).", '$urlizedTitle')",$session{dbh});
|
||||
WebGUI::SQL->write("insert into page values (".getNextId("pageId").", $session{page}{pageId}, ".quote($session{form}{title}).", $session{page}{styleId}, $session{user}{userId}, $session{page}{ownerView}, $session{page}{ownerEdit}, $session{page}{groupId}, $session{page}{groupView}, $session{page}{groupEdit}, $session{page}{worldView}, $session{page}{worldEdit}, '$nextSeq', ".quote($session{form}{metaTags}).", '$urlizedTitle', '$session{form}{defaultMetaTags}')",$session{dbh});
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -150,6 +151,7 @@ sub www_editPage {
|
|||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,$session{page}{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(104).'</td><td>'.WebGUI::Form::text("urlizedTitle",20,30,$session{page}{urlizedTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(100).'</td><td>'.WebGUI::Form::textArea("metaTags",$session{page}{metaTags}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(307).'</td><td>'.WebGUI::Form::checkbox("defaultMetaTags",1,$session{page}{defaultMetaTags}).'</td></tr>';
|
||||
$output .= '<tr><td colspan=2><hr size=1><b>'.WebGUI::International::get(105).'</b></td></tr>';
|
||||
%hash = WebGUI::SQL->buildHash("select styleId,name from style where name<>'Reserved' order by name",$session{dbh});
|
||||
$array[0] = $session{page}{styleId};
|
||||
|
|
@ -191,7 +193,7 @@ sub www_editPageSave {
|
|||
while (($test) = WebGUI::SQL->quickArray("select urlizedTitle from page where urlizedTitle='$urlizedTitle' and pageId<>$session{page}{pageId}",$session{dbh})) {
|
||||
$urlizedTitle .= 2;
|
||||
}
|
||||
WebGUI::SQL->write("update page set title=".quote($session{form}{title}).", styleId=$session{form}{styleId}, ownerId=$session{form}{ownerId}, ownerView=$session{form}{ownerView}, ownerEdit=$session{form}{ownerEdit}, groupId='$session{form}{groupId}', groupView=$session{form}{groupView}, groupEdit=$session{form}{groupEdit}, worldView=$session{form}{worldView}, worldEdit=$session{form}{worldEdit}, metaTags=".quote($session{form}{metaTags}).", urlizedTitle='$urlizedTitle' where pageId=$session{page}{pageId}",$session{dbh});
|
||||
WebGUI::SQL->write("update page set title=".quote($session{form}{title}).", styleId=$session{form}{styleId}, ownerId=$session{form}{ownerId}, ownerView=$session{form}{ownerView}, ownerEdit=$session{form}{ownerEdit}, groupId='$session{form}{groupId}', groupView=$session{form}{groupView}, groupEdit=$session{form}{groupEdit}, worldView=$session{form}{worldView}, worldEdit=$session{form}{worldEdit}, metaTags=".quote($session{form}{metaTags}).", urlizedTitle='$urlizedTitle', defaultMetaTags='$session{form}{defaultMetaTags}' where pageId=$session{page}{pageId}",$session{dbh});
|
||||
if ($session{form}{recurseStyle} eq "yes") {
|
||||
_recursivelyChangeStyle($session{page}{pageId});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ sub www_editAuthenticationSettings {
|
|||
%authMethod = ('WebGUI'=>'WebGUI', 'LDAP'=>'LDAP');
|
||||
%yesNo = ('yes'=>WebGUI::International::get(138), 'no'=>WebGUI::International::get(139));
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=2"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(117).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editAuthenticationSettingsSave");
|
||||
|
|
@ -37,6 +37,8 @@ sub www_editAuthenticationSettings {
|
|||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(118).'</td><td>'.WebGUI::Form::selectList("anonymousRegistration",\%yesNo, \@array).'</td></tr>';
|
||||
$array[0] = $session{setting}{authMethod};
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(119).'</td><td>'.WebGUI::Form::selectList("authMethod",\%authMethod, \@array).'</td></tr>';
|
||||
$array[0] = $session{setting}{usernameBinding};
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(306).'</td><td>'.WebGUI::Form::selectList("usernameBinding",\%yesNo, \@array).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(120).'</td><td>'.WebGUI::Form::text("ldapURL",30,2048,$session{setting}{ldapURL}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(121).'</td><td>'.WebGUI::Form::text("ldapId",30,100,$session{setting}{ldapId}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(122).'</td><td>'.WebGUI::Form::text("ldapIdName",30,100,$session{setting}{ldapIdName}).'</td></tr>';
|
||||
|
|
@ -59,6 +61,7 @@ sub www_editAuthenticationSettingsSave {
|
|||
WebGUI::SQL->write("update settings set value=".quote($session{form}{ldapIdName})." where name='ldapIdName'",$session{dbh});
|
||||
WebGUI::SQL->write("update settings set value=".quote($session{form}{ldapPasswordName})." where name='ldapPasswordName'",$session{dbh});
|
||||
WebGUI::SQL->write("update settings set value=".quote($session{form}{anonymousRegistration})." where name='anonymousRegistration'",$session{dbh});
|
||||
WebGUI::SQL->write("update settings set value=".quote($session{form}{usernameBinding})." where name='usernameBinding'",$session{dbh});
|
||||
return www_manageSettings();
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
|
|
@ -69,7 +72,7 @@ sub www_editAuthenticationSettingsSave {
|
|||
sub www_editCompanyInformation {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=6"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(124).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editCompanyInformationSave");
|
||||
|
|
@ -102,7 +105,7 @@ sub www_editCompanyInformationSave {
|
|||
sub www_editFileSettings {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=11"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(128).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editFileSettingsSave");
|
||||
|
|
@ -126,7 +129,7 @@ sub www_editFileSettingsSave {
|
|||
WebGUI::SQL->write("update settings set value=".quote($session{form}{lib})." where name='lib'",$session{dbh});
|
||||
WebGUI::SQL->write("update settings set value=".quote($session{form}{maxAttachmentSize})." where name='maxAttachmentSize'",$session{dbh});
|
||||
WebGUI::SQL->write("update settings set value=".quote($session{form}{attachmentDirectoryWeb})." where name='attachmentDirectoryWeb'",$session{dbh});
|
||||
WebGUI::SQL->write("update settings set value=".quote($session{form}{attachmentDirectoryLocal})." wherename='attachmentDirectoryLocal'",$session{dbh});
|
||||
WebGUI::SQL->write("update settings set value=".quote($session{form}{attachmentDirectoryLocal})." where name='attachmentDirectoryLocal'",$session{dbh});
|
||||
return www_manageSettings();
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
|
|
@ -137,7 +140,7 @@ sub www_editFileSettingsSave {
|
|||
sub www_editMailSettings {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=13"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(133).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editMailSettingsSave");
|
||||
|
|
@ -169,7 +172,7 @@ sub www_editMiscSettings {
|
|||
my ($output, @array, %notFoundPage);
|
||||
%notFoundPage = (1=>WebGUI::International::get(136), 4=>WebGUI::International::get(137));
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=24"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(140).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editMiscSettingsSave");
|
||||
|
|
@ -191,7 +194,7 @@ sub www_editMiscSettingsSave {
|
|||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
WebGUI::SQL->write("update settings set value=".quote($session{form}{sessionTimeout})." where name='sessionTimeout'",$session{dbh});
|
||||
WebGUI::SQL->write("update settings set value=".quote($session{form}{notFoundPage})." where name='notFoundPage'",$session{dbh});
|
||||
return "";
|
||||
return www_manageSettings();
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ use WebGUI::SQL;
|
|||
use WebGUI::Utility;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(&www_addStyle &www_addStyleSave &www_deleteStyle &www_deleteStyleConfirm &www_editStyle &www_editStyleSave &www_listStyles);
|
||||
our @EXPORT = qw(&www_copyStyle &www_addStyle &www_addStyleSave &www_deleteStyle &www_deleteStyleConfirm &www_editStyle &www_editStyleSave &www_listStyles);
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_addStyle {
|
||||
|
|
@ -57,6 +57,18 @@ sub www_addStyleSave {
|
|||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_copyStyle {
|
||||
my (%style);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
%style = WebGUI::SQL->quickHash("select * from style where styleId=$session{form}{sid}",$session{dbh});
|
||||
WebGUI::SQL->write("insert into style values (".getNextId("styleId").", ".quote('Copy of '.$style{name}).", ".quote($style{header}).", ".quote($style{footer}).", ".quote($style{styleSheet}).")",$session{dbh});
|
||||
return www_listStyles();
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteStyle {
|
||||
my ($output);
|
||||
|
|
@ -132,7 +144,7 @@ sub www_listStyles {
|
|||
$output .= '<table border=1 cellpadding=5 cellspacing=0 align="center">';
|
||||
$sth = WebGUI::SQL->read("select styleId,name from style where name<>'Reserved' order by name",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
$row[$i] = '<tr><td valign="top"><a href="'.$session{page}{url}.'?op=deleteStyle&sid='.$data[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?op=editStyle&sid='.$data[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a></td>';
|
||||
$row[$i] = '<tr><td valign="top"><a href="'.$session{page}{url}.'?op=deleteStyle&sid='.$data[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?op=editStyle&sid='.$data[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?op=copyStyle&sid='.$data[0].'"><img src="'.$session{setting}{lib}.'/copy.gif" border=0></a></td>';
|
||||
$row[$i] .= '<td valign="top">'.$data[1].'</td></tr>';
|
||||
$i++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,9 +30,11 @@ sub getStyle {
|
|||
<head>
|
||||
<title>'.$session{page}{title}.'</title>'
|
||||
.$style{styleSheet}
|
||||
.$session{page}{metaTags}
|
||||
.'</head>'
|
||||
.$style{header};
|
||||
.$session{page}{metaTags};
|
||||
if ($session{page}{defaultMetaTags}) {
|
||||
$header .= '<meta http-equiv="Keywords" name="Keywords" content="'.$session{page}{title}.', '.$session{setting}{companyName}.'">';
|
||||
}
|
||||
$header .= '</head>'.$style{header};
|
||||
$footer = $style{footer}.'
|
||||
</html>';
|
||||
$header = WebGUI::Macro::process($header);
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ sub www_edit {
|
|||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(254).'</td><td>'.WebGUI::Form::text("graphWidth",20,3,$data{graphWidth}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(255).'</td><td>'.WebGUI::Form::text("question",50,255,$data{question}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(256).'<span><br>'.WebGUI::International::get(257).'</span></td><td>'.WebGUI::Form::textArea("answers",$data{a1}."\n".$data{a2}."\n".$data{a3}."\n".$data{a4}."\n".$data{a5}."\n".$data{a6}."\n".$data{a7}."\n".$data{a8}."\n".$data{a9}."\n".$data{a10}."\n".$data{a11}."\n".$data{a12}."\n".$data{a13}."\n".$data{a14}."\n".$data{a15}."\n".$data{a16}."\n".$data{a17}."\n".$data{a18}."\n".$data{a19}."\n".$data{a20}."\n",50,8,0,'on').'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).' <a href="'.$session{page}{url}.'?func=resetVotes&wid='.$session{form}{wid}.'">'.WebGUI::International::get(305).'</a></td></tr>';
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -179,6 +179,14 @@ sub www_editSave {
|
|||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_resetVotes {
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
WebGUI::SQL->write("delete from pollAnswer where widgetId='$session{form}{wid}'",$session{dbh});
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my ($hasVoted, %data, $output);
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ sub www_deleteAttachment {
|
|||
my ($owner);
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
if ($owner == $session{user}{userId}) {
|
||||
WebGUI::SQL->write("update submission set attachment='' where widgetId=$session{form}{wid}",$session{dbh});
|
||||
WebGUI::SQL->write("update submission set attachment='' where submissionId=$session{form}{sid}",$session{dbh});
|
||||
return www_editSubmission();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -143,7 +143,7 @@ sub www_deleteImage {
|
|||
my ($owner);
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
if ($owner == $session{user}{userId}) {
|
||||
WebGUI::SQL->write("update submission set image='' where widgetId=$session{form}{wid}",$session{dbh});
|
||||
WebGUI::SQL->write("update submission set image='' where submissionId=$session{form}{sid}",$session{dbh});
|
||||
return www_editSubmission();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
|
|||
|
|
@ -60,6 +60,13 @@ if (eval { require Tie::CPHash }) {
|
|||
print "Please install.\n";
|
||||
}
|
||||
|
||||
print "Net::SMTP module:\t";
|
||||
if (eval { require Net::SMTP }) {
|
||||
print "OK\n";
|
||||
} else {
|
||||
print "Please install.\n";
|
||||
}
|
||||
|
||||
print "XML::RSS module:\t";
|
||||
if (eval { require XML::RSS }) {
|
||||
print "OK\n";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue