WebGUI 2.3.4 release
This commit is contained in:
parent
73909699ff
commit
2a61818564
11 changed files with 658 additions and 22 deletions
|
|
@ -444,11 +444,13 @@ sub www_updateAccount {
|
|||
$error .= '"'.$session{form}{username}.'_'.WebGUI::DateTime::epochToHuman(time(),"%y").'"';
|
||||
$error .= '<p>';
|
||||
}
|
||||
if ($session{form}{identifier1} ne "password" && _hasBadPassword($session{form}{identifier1},$session{form}{identifier2})) {
|
||||
$error .= WebGUI::International::get(78).'<p>';
|
||||
} else {
|
||||
$encryptedPassword = Digest::MD5::md5_base64($session{form}{identifier1});
|
||||
$passwordStatement = ', identifier='.quote($encryptedPassword);
|
||||
if ($session{form}{identifier1} ne "password") {
|
||||
if (_hasBadPassword($session{form}{identifier1},$session{form}{identifier2})) {
|
||||
$error .= WebGUI::International::get(78).'<p>';
|
||||
} else {
|
||||
$encryptedPassword = Digest::MD5::md5_base64($session{form}{identifier1});
|
||||
$passwordStatement = ', identifier='.quote($encryptedPassword);
|
||||
}
|
||||
}
|
||||
if ($error eq "") {
|
||||
$encryptedPassword = Digest::MD5::md5_base64($session{form}{identifier1});
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ sub www_addPageSave {
|
|||
my ($urlizedTitle, $test, $nextSeq);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from page where parentId=$session{page}{pageId}",$session{dbh});
|
||||
$urlizedTitle = urlizeTitle($session{form}{title});
|
||||
$urlizedTitle = urlize($session{form}{title});
|
||||
while (($test) = WebGUI::SQL->quickArray("select urlizedTitle from page where urlizedTitle='$urlizedTitle'",$session{dbh})) {
|
||||
$urlizedTitle .= 2;
|
||||
}
|
||||
|
|
@ -189,7 +189,7 @@ sub www_editPage {
|
|||
sub www_editPageSave {
|
||||
my (%parent, $urlizedTitle, $test);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$urlizedTitle = urlizeTitle($session{form}{urlizedTitle});
|
||||
$urlizedTitle = urlize($session{form}{urlizedTitle});
|
||||
while (($test) = WebGUI::SQL->quickArray("select urlizedTitle from page where urlizedTitle='$urlizedTitle' and pageId<>$session{page}{pageId}",$session{dbh})) {
|
||||
$urlizedTitle .= 2;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use WebGUI::Session;
|
|||
use WebGUI::SQL;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(&randint &getNextId &saveAttachment &round &urlizeTitle "e);
|
||||
our @EXPORT = qw(&randint &getNextId &saveAttachment &round &urlize "e);
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub getNextId {
|
||||
|
|
@ -54,10 +54,13 @@ sub round {
|
|||
sub saveAttachment {
|
||||
my ($file, $filename, $bytesread, $buffer, $urlizedFilename, $path);
|
||||
$filename = $session{cgi}->upload($_[0]);
|
||||
#$filename = $session{form}{$_[0]};
|
||||
#$filename = $session{cgi}->param($_[0]);
|
||||
if (defined $filename) {
|
||||
$urlizedFilename = urlizeTitle($filename);
|
||||
if ($filename =~ /([^\/\\]+)$/) {
|
||||
$urlizedFilename = $1;
|
||||
} else {
|
||||
$urlizedFilename = $filename;
|
||||
}
|
||||
$urlizedFilename = urlize($urlizedFilename);
|
||||
$path = $session{setting}{attachmentDirectoryLocal}."/".$_[1]."/";
|
||||
mkdir ($path,0755);
|
||||
if ($_[2] ne "") {
|
||||
|
|
@ -65,6 +68,7 @@ sub saveAttachment {
|
|||
mkdir ($path,0755);
|
||||
}
|
||||
$file = FileHandle->new(">".$path.$urlizedFilename);
|
||||
binmode $file;
|
||||
if (defined $file) {
|
||||
while ($bytesread=read($filename,$buffer,1024)) {
|
||||
print $file $buffer;
|
||||
|
|
@ -80,7 +84,7 @@ sub saveAttachment {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub urlizeTitle {
|
||||
sub urlize {
|
||||
my ($title);
|
||||
$title = lc($_[0]);
|
||||
$title =~ s/ /_/g;
|
||||
|
|
|
|||
|
|
@ -46,9 +46,10 @@ sub www_add {
|
|||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,'Events Calendar').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(1,$namespace).'</td><td>'.WebGUI::Form::checkbox("proceed",1,1).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
|
|
@ -64,7 +65,12 @@ sub www_addSave {
|
|||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$widgetId = create();
|
||||
WebGUI::SQL->write("insert into FAQ values ($widgetId)",$session{dbh});
|
||||
return "";
|
||||
if ($session{form}{proceed} == 1) {
|
||||
$session{form}{wid} = $widgetId;
|
||||
return www_addEvent();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ sub www_add {
|
|||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",'','','',1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(1,$namespace).'</td><td>'.WebGUI::Form::checkbox("proceed",1,1).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
|
|
@ -74,7 +75,12 @@ sub www_addSave {
|
|||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$widgetId = create();
|
||||
WebGUI::SQL->write("insert into FAQ values ($widgetId)",$session{dbh});
|
||||
return "";
|
||||
if ($session{form}{proceed} == 1) {
|
||||
$session{form}{wid} = $widgetId;
|
||||
return www_addQuestion();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ sub www_add {
|
|||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(1,$namespace).'</td><td>'.WebGUI::Form::text("indent",20,2,0).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(2,$namespace).'</td><td>'.WebGUI::Form::text("lineSpacing",20,1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(4,$namespace).'</td><td>'.WebGUI::Form::text("bullet",20,255,'·').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(5,$namespace).'</td><td>'.WebGUI::Form::checkbox("proceed",1,1).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
|
|
@ -77,7 +78,12 @@ sub www_addSave {
|
|||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$widgetId = create();
|
||||
WebGUI::SQL->write("insert into LinkList values ($widgetId, '$session{form}{indent}', '$session{form}{lineSpacing}', ".quote($session{form}{bullet}).")",$session{dbh});
|
||||
return "";
|
||||
if ($session{form}{proceed} == 1) {
|
||||
$session{form}{wid} = $widgetId;
|
||||
return www_addLink();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue