This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#retrieve values from form for the new community | |
my $communityDisplayName = getInParam('display_name'); | |
our $communityName = getInParam('display_name'); | |
$communityName =~ s/[^a-z0-9_~\-]/_/g; | |
my $communityTitle = getInParam('title'); | |
my $description = getInParam('description'); | |
my $templateID = getInParam('template'); | |
my $type = getInParam('type') || 'community'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#retrieve values from form for the new community | |
our $communityName = getInParam('name'); | |
my $communityTitle = getInParam('title'); | |
my $description = getInParam('description'); | |
my $templateID = getInParam('template'); | |
my $type = getInParam('type') || 'community'; | |
my $parent = getInParam('parent'); | |
my $nestingType = getInParam('nestingType'); | |
if($parent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub create($%) { | |
my GCX::Runtime::Community $self = shift; | |
my (%params) = @_; | |
my $system = $params{'system'}; | |
#short-circuit on invalid community names or invalid guid | |
($params{'name'} = $params{'display_name'}) =~ s/[^a-z0-9_~\-]/_/g; | |
return undef if(!$self->isValidName($params{'name'}, $system) ||$params{'guid'} !~ /^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/io); | |
#default values |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def set_locale | |
locales = ['en-US', 'en-AU'] | |
begin | |
# Try to auto-detect it | |
if request.headers['Accept-Language'] | |
browser_language = request.headers['Accept-Language'].split(',')[0] | |
browser_language = browser_language.split('-')[0] + '-' + browser_language.split('-')[1].upcase | |
session[:locale] = browser_language | |
end | |
session[:locale] = params[:locale] if params[:locale] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
if (count($_FILES)) { | |
// Handle degraded form uploads here. Degraded form uploads are POSTed to index.php. SWFUpload uploads | |
// are POSTed to upload.php | |
} | |
?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_POST["PHPSESSID"])) { | |
session_id($_POST["PHPSESSID"]); | |
} | |
session_start(); | |
if (!isset($_FILES["Filedata"]) || !is_uploaded_file($_FILES["Filedata"]["tmp_name"]) || $_FILES["Filedata"]["error"] != 0) { | |
// Usually we'll only get an invalid upload if our PHP.INI upload sizes are smaller than the size of the file we allowed | |
// to be uploaded. | |
header("HTTP/1.1 500 File Upload Error"); |
NewerOlder