Skip to content

Instantly share code, notes, and snippets.

#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';
We couldn’t find that file to show.
#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)
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
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]
<?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">
<?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");