Commit 040ea3be authored by Leigh B Stoller's avatar Leigh B Stoller

Change "genesis" to "portal" what the hell was I thinking when I

picked genesis. But this change actually has content; we need to
distinguish between classic projects and emulab portal projects
(new projects created via the portal, and used via the portal).  For now
these are distinct until we decide to bring everyone up to the new
interface.
parent ef9c1265
#!/usr/bin/perl -wT #!/usr/bin/perl -wT
# #
# Copyright (c) 2000-2011, 2014 University of Utah and the Flux Group. # Copyright (c) 2000-2011, 2014, 2016 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -42,7 +42,7 @@ my $debug = 0; ...@@ -42,7 +42,7 @@ my $debug = 0;
my $nonlocal= 0; my $nonlocal= 0;
my $impotent= 0; my $impotent= 0;
my $silent = 0; my $silent = 0;
my $genesis; my $portal;
my $resend; my $resend;
# #
...@@ -224,12 +224,12 @@ fatal($@) ...@@ -224,12 +224,12 @@ fatal($@)
if ($@); if ($@);
# APT flag. Notice and delete. # APT flag. Notice and delete.
if (exists($xmlparse->{'attribute'}->{"genesis"})) { if (exists($xmlparse->{'attribute'}->{"portal"})) {
$genesis = $xmlparse->{'attribute'}->{"genesis"}->{'value'}; $portal = $xmlparse->{'attribute'}->{"portal"}->{'value'};
delete($xmlparse->{'attribute'}->{"genesis"}); delete($xmlparse->{'attribute'}->{"portal"});
if (! ($genesis eq "aptlab" || $genesis eq "cloudlab" || if (! ($portal eq "aptlab" || $portal eq "cloudlab" ||
$genesis eq "phantomnet")) { $portal eq "phantomnet" || $portal eq "emulab")) {
fatal("Bad genesis: $genesis"); fatal("Bad portal: $portal");
} }
} }
...@@ -375,9 +375,9 @@ exit(0) ...@@ -375,9 +375,9 @@ exit(0)
my $new_pid = $newproj_args{'pid'}; my $new_pid = $newproj_args{'pid'};
delete($newproj_args{'pid'}); delete($newproj_args{'pid'});
delete($newproj_args{'head_uid'}); delete($newproj_args{'head_uid'});
# Genesis (APT, CloudLab, or PhantomNet) # Portal (Emulab, APT, CloudLab, or PhantomNet)
$newproj_args{'genesis'} = $genesis $newproj_args{'portal'} = $portal
if (defined($genesis)); if (defined($portal));
my $newproj = Project->Create($new_pid, $leader, \%newproj_args); my $newproj = Project->Create($new_pid, $leader, \%newproj_args);
if (!defined($newproj)) { if (!defined($newproj)) {
......
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# Copyright (c) 2000-2015 University of Utah and the Flux Group. # Copyright (c) 2000-2016 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -41,8 +41,7 @@ my $debug = 0; ...@@ -41,8 +41,7 @@ my $debug = 0;
my $impotent= 0; my $impotent= 0;
my $type = ""; my $type = "";
my $silent = 0; my $silent = 0;
my $portal = 0; my $portal;
my $genesis;
my @keyfiles = (); my @keyfiles = ();
# #
...@@ -212,12 +211,12 @@ print STDERR Dumper($xmlparse) ...@@ -212,12 +211,12 @@ print STDERR Dumper($xmlparse)
if ($debug); if ($debug);
# APT flag. Notice and delete. # APT flag. Notice and delete.
if (exists($xmlparse->{'attribute'}->{"genesis"})) { if (exists($xmlparse->{'attribute'}->{"portal"})) {
$genesis = $xmlparse->{'attribute'}->{"genesis"}->{'value'}; $portal = $xmlparse->{'attribute'}->{"portal"}->{'value'};
delete($xmlparse->{'attribute'}->{"genesis"}); delete($xmlparse->{'attribute'}->{"portal"});
if (! ($genesis eq "aptlab" || $genesis eq "cloudlab" || if (! ($portal eq "aptlab" || $portal eq "cloudlab" ||
$genesis eq "phantomnet")) { $portal eq "phantomnet" || $portal eq "emulab")) {
fatal("Bad genesis: $genesis"); fatal("Bad portal: $portal");
} }
# Remove these, we do not require them on the APT path. # Remove these, we do not require them on the APT path.
delete($required{"affiliation_abbreviation"}); delete($required{"affiliation_abbreviation"});
...@@ -435,9 +434,9 @@ if (exists($newuser_args{'uid'})) { ...@@ -435,9 +434,9 @@ if (exists($newuser_args{'uid'})) {
$new_uid = $newuser_args{'uid'}; $new_uid = $newuser_args{'uid'};
delete($newuser_args{'uid'}); delete($newuser_args{'uid'});
} }
# Genesis (APT, CloudLab or PhantomNet) # Portal (Emulab, APT, CloudLab or PhantomNet)
$newuser_args{'genesis'} = $genesis $newuser_args{'portal'} = $portal
if (defined($genesis)); if (defined($portal));
# #
# The type modifier comes in on the command line since this is available # The type modifier comes in on the command line since this is available
...@@ -461,7 +460,7 @@ my $newuser = User->Create($new_uid, $flags, \%newuser_args); ...@@ -461,7 +460,7 @@ my $newuser = User->Create($new_uid, $flags, \%newuser_args);
if (!defined($newuser)) { if (!defined($newuser)) {
fatal("Could not create new user!"); fatal("Could not create new user!");
} }
if (defined($genesis)) { if (defined($portal)) {
$newuser->SetStatus(USERSTATUS_UNAPPROVED()); $newuser->SetStatus(USERSTATUS_UNAPPROVED());
} }
my $key = $newuser->verify_key(); my $key = $newuser->verify_key();
...@@ -532,7 +531,7 @@ SENDMAIL("$usr_name '$usr_uid' <$usr_email>", ...@@ -532,7 +531,7 @@ SENDMAIL("$usr_name '$usr_uid' <$usr_email>",
"Testbed Operations\n", "Testbed Operations\n",
"$TBAPPROVAL", "$TBAPPROVAL",
"Bcc: $TBAUDIT") "Bcc: $TBAUDIT")
if (!($silent || defined($genesis))); if (!($silent || defined($portal)));
# #
# Do we have a keyfile? If so, rerun addpubkey for real now that the # Do we have a keyfile? If so, rerun addpubkey for real now that the
......
...@@ -49,7 +49,11 @@ sub Create($$) ...@@ -49,7 +49,11 @@ sub Create($$)
{ {
my ($class, $brand) = @_; my ($class, $brand) = @_;
if ($brand =~ /aptlab/) { # No brand means the classic interface.
if (!defined($brand)) {
$brand = "classic";
}
elsif ($brand =~ /aptlab/) {
$brand = "aptlab"; $brand = "aptlab";
} }
elsif ($brand =~ /cloudlab/) { elsif ($brand =~ /cloudlab/) {
...@@ -59,6 +63,7 @@ sub Create($$) ...@@ -59,6 +63,7 @@ sub Create($$)
$brand = "phantomnet"; $brand = "phantomnet";
} }
else { else {
# This means the new Portal interface.
$brand = "emulab"; $brand = "emulab";
} }
my $self = {}; my $self = {};
...@@ -72,6 +77,7 @@ sub isAPT($) { return $_[0]->brand() eq "aptlab" ? 1 : 0; } ...@@ -72,6 +77,7 @@ sub isAPT($) { return $_[0]->brand() eq "aptlab" ? 1 : 0; }
sub isCloud($) { return $_[0]->brand() eq "cloudlab" ? 1 : 0; } sub isCloud($) { return $_[0]->brand() eq "cloudlab" ? 1 : 0; }
sub isPNet($) { return $_[0]->brand() eq "phantomnet" ? 1 : 0; } sub isPNet($) { return $_[0]->brand() eq "phantomnet" ? 1 : 0; }
sub isEmulab($) { return $_[0]->brand() eq "emulab" ? 1 : 0; } sub isEmulab($) { return $_[0]->brand() eq "emulab" ? 1 : 0; }
sub isClassic($) { return $_[0]->brand() eq "classic" ? 1 : 0; }
sub wwwBase($) sub wwwBase($)
{ {
...@@ -80,6 +86,7 @@ sub wwwBase($) ...@@ -80,6 +86,7 @@ sub wwwBase($)
return ($self->isAPT() ? "https://www.aptlab.net" : return ($self->isAPT() ? "https://www.aptlab.net" :
$self->isCloud() ? "https://www.cloudlab.us" : $self->isCloud() ? "https://www.cloudlab.us" :
$self->isPNet() ? "https://www.phantomnet.org" : $self->isPNet() ? "https://www.phantomnet.org" :
$self->isEmulab() ? "@TBBASE@" . "/portal" :
"@TBBASE@"); "@TBBASE@");
} }
...@@ -139,7 +146,8 @@ sub SignupURL($$) ...@@ -139,7 +146,8 @@ sub SignupURL($$)
my $wwwbase = $self->wwwBase(); my $wwwbase = $self->wwwBase();
my $pid = $project->pid(); my $pid = $project->pid();
return ($self->isAPT() || $self->isCloud() || $self->isPNet() ? return ($self->isAPT() || $self->isCloud() ||
$self->isPNet() || $self->isEmulab() ?
"${wwwbase}/signup.php?pid=$pid" : "${wwwbase}/signup.php?pid=$pid" :
"${wwwbase}/joinproject.php3?target_pid=$pid"); "${wwwbase}/joinproject.php3?target_pid=$pid");
} }
......
...@@ -108,7 +108,7 @@ sub Lookup($$) ...@@ -108,7 +108,7 @@ sub Lookup($$)
if (!defined($self->{'GROUP'})); if (!defined($self->{'GROUP'}));
bless($self, $class); bless($self, $class);
$self->{'BRAND'} = Brand->Create($self->genesis()); $self->{'BRAND'} = Brand->Create($self->portal());
# Add to cache. # Add to cache.
$projects{$self->{'PROJECT'}->{'pid_idx'}} = $self; $projects{$self->{'PROJECT'}->{'pid_idx'}} = $self;
...@@ -148,7 +148,7 @@ sub IsNonLocal($) { return (defined($_[0]->nonlocal_id()) ? 1 : 0); }; ...@@ -148,7 +148,7 @@ sub IsNonLocal($) { return (defined($_[0]->nonlocal_id()) ? 1 : 0); };
sub nonlocal_id($) { return field($_[0], "nonlocal_id"); } sub nonlocal_id($) { return field($_[0], "nonlocal_id"); }
sub nonlocal_type($) { return field($_[0], "nonlocal_type"); } sub nonlocal_type($) { return field($_[0], "nonlocal_type"); }
sub manager_urn($) { return field($_[0], "manager_urn"); } sub manager_urn($) { return field($_[0], "manager_urn"); }
sub genesis($) { return field($_[0], "genesis"); } sub portal($) { return field($_[0], "portal"); }
sub Brand($) { return $_[0]->{'BRAND'}; } sub Brand($) { return $_[0]->{'BRAND'}; }
sub isAPT($) { return $_[0]->Brand()->isAPT() ? 1 : 0; } sub isAPT($) { return $_[0]->Brand()->isAPT() ? 1 : 0; }
sub isCloud($) { return $_[0]->Brand()->isCloud() ? 1 : 0; } sub isCloud($) { return $_[0]->Brand()->isCloud() ? 1 : 0; }
......
...@@ -147,7 +147,7 @@ sub Lookup($$) ...@@ -147,7 +147,7 @@ sub Lookup($$)
$self->{'USER'} = $query_result->fetchrow_hashref(); $self->{'USER'} = $query_result->fetchrow_hashref();
bless($self, $class); bless($self, $class);
$self->{'BRAND'} = Brand->Create($self->genesis()); $self->{'BRAND'} = Brand->Create($self->portal());
# Add to cache. # Add to cache.
$users{$self->{'USER'}->{'uid_idx'}} = $self; $users{$self->{'USER'}->{'uid_idx'}} = $self;
...@@ -217,7 +217,7 @@ sub nonlocal_id($) { return field($_[0], "nonlocal_id"); } ...@@ -217,7 +217,7 @@ sub nonlocal_id($) { return field($_[0], "nonlocal_id"); }
sub nonlocal_type($) { return field($_[0], "nonlocal_type"); } sub nonlocal_type($) { return field($_[0], "nonlocal_type"); }
sub IsLocal($) { return (defined($_[0]->nonlocal_id()) ? 0 : 1); }; sub IsLocal($) { return (defined($_[0]->nonlocal_id()) ? 0 : 1); };
sub IsNonLocal($) { return (defined($_[0]->nonlocal_id()) ? 1 : 0); }; sub IsNonLocal($) { return (defined($_[0]->nonlocal_id()) ? 1 : 0); };
sub genesis($) { return field($_[0], "genesis"); } sub portal($) { return field($_[0], "portal"); }
sub Brand($) { return $_[0]->{'BRAND'}; } sub Brand($) { return $_[0]->{'BRAND'}; }
sub isAPT($) { return $_[0]->Brand()->isAPT() ? 1 : 0; } sub isAPT($) { return $_[0]->Brand()->isAPT() ? 1 : 0; }
sub isCloud($) { return $_[0]->Brand()->isCloud() ? 1 : 0; } sub isCloud($) { return $_[0]->Brand()->isCloud() ? 1 : 0; }
......
...@@ -31,14 +31,14 @@ use Date::Parse; ...@@ -31,14 +31,14 @@ use Date::Parse;
# #
sub usage() sub usage()
{ {
print STDERR "Usage: announce -a <-g genesis> [-s alert_style] [-b button_label] [-u action_url] [-m max_seen_count] <announcement_text>\n"; print STDERR "Usage: announce -a <-p portal> [-s alert_style] [-b button_label] [-u action_url] [-m max_seen_count] <announcement_text>\n";
print STDERR " announce -l [active|retired|all]\n"; print STDERR " announce -l [active|retired|all]\n";
print STDERR " announce -r idx\n"; print STDERR " announce -r idx\n";
print STDERR " announce -i idx\n"; print STDERR " announce -i idx\n";
print STDERR " announce -h\n"; print STDERR " announce -h\n";
print STDERR " -h This message\n"; print STDERR " -h This message\n";
print STDERR " -a Create a new announcement with the given announcement text.\n"; print STDERR " -a Create a new announcement with the given announcement text.\n";
print STDERR " -g Set the genesis to be the one given. Should be one of 'cloudlab', 'emulab', 'aptlab', 'phantomnet'.\n"; print STDERR " -p Set the portal to be the one given. Should be one of 'cloudlab', 'emulab', 'aptlab', 'phantomnet'.\n";
print STDERR " -s Set the style of the overall announcement box. Should normally be one of bootstraps alert-* classes. Defaults to 'alert-info'.\n"; print STDERR " -s Set the style of the overall announcement box. Should normally be one of bootstraps alert-* classes. Defaults to 'alert-info'.\n";
print STDERR " -b If there is an action associated with this announcement, this is the text which goes into the action button. Can include HTML. If it is unset, there is no action button.\n"; print STDERR " -b If there is an action associated with this announcement, this is the text which goes into the action button. Can include HTML. If it is unset, there is no action button.\n";
print STDERR " -u URL of action associated with this announcement. {uid_idx} and {uid} can be used as URL templates to generate a different URL on a per-user basis. If it is unset, there is no action button.\n"; print STDERR " -u URL of action associated with this announcement. {uid_idx} and {uid} can be used as URL templates to generate a different URL on a per-user basis. If it is unset, there is no action button.\n";
...@@ -48,12 +48,12 @@ sub usage() ...@@ -48,12 +48,12 @@ sub usage()
print STDERR " -i Info about a particular announcement.\n"; print STDERR " -i Info about a particular announcement.\n";
exit(-1); exit(-1);
} }
my $optlist = "hag:s:b:u:m:lr:i:"; my $optlist = "hap:s:b:u:m:lr:i:";
my $add_mode = 0; my $add_mode = 0;
my $list_mode = 0; my $list_mode = 0;
my $retire_mode = 0; my $retire_mode = 0;
my $info_mode = 0; my $info_mode = 0;
my $genesis = undef; my $portal = undef;
my $style = "alert-info"; my $style = "alert-info";
my $button = undef; my $button = undef;
my $url = undef; my $url = undef;
...@@ -117,8 +117,8 @@ if (defined($options{"i"})) { ...@@ -117,8 +117,8 @@ if (defined($options{"i"})) {
$info_mode = 1; $info_mode = 1;
$info_idx = $options{"i"}; $info_idx = $options{"i"};
} }
if (defined($options{"g"})) { if (defined($options{"p"})) {
$genesis = $options{"g"}; $portal = $options{"p"};
} }
if (defined($options{"s"})) { if (defined($options{"s"})) {
$style = $options{"s"}; $style = $options{"s"};
...@@ -137,7 +137,7 @@ if ($add_mode + $list_mode + $retire_mode + $info_mode != 1) { ...@@ -137,7 +137,7 @@ if ($add_mode + $list_mode + $retire_mode + $info_mode != 1) {
usage(); usage();
} }
if ($add_mode and ! defined($genesis)) { if ($add_mode and ! defined($portal)) {
usage(); usage();
} }
...@@ -159,7 +159,7 @@ if ($add_mode) { ...@@ -159,7 +159,7 @@ if ($add_mode) {
# #
my $query = "insert into apt_announcements set "; my $query = "insert into apt_announcements set ";
$query .= "created=NOW()"; $query .= "created=NOW()";
$query .= ", genesis=" . DBQuoteSpecial($genesis); $query .= ", portal=" . DBQuoteSpecial($portal);
$query .= ", max_seen=" . DBQuoteSpecial($max_seen); $query .= ", max_seen=" . DBQuoteSpecial($max_seen);
$query .= ", text=" . DBQuoteSpecial($text); $query .= ", text=" . DBQuoteSpecial($text);
$query .= ", style=" . DBQuoteSpecial($style); $query .= ", style=" . DBQuoteSpecial($style);
...@@ -179,16 +179,16 @@ if ($add_mode) { ...@@ -179,16 +179,16 @@ if ($add_mode) {
$condition = "retired=1 and "; $condition = "retired=1 and ";
} }
$query_result = $query_result =
DBQueryFatal("select idx, genesis, text from apt_announcements where ".$condition."uid_idx is NULL"); DBQueryFatal("select idx, portal, text from apt_announcements where ".$condition."uid_idx is NULL");
print "idx\tGenesis Text\n"; print "idx\tPortal Text\n";
print "---\t------- ----\n"; print "---\t------- ----\n";
while (my ($idx, $genesis, $text) = $query_result->fetchrow_array()) { while (my ($idx, $portal, $text) = $query_result->fetchrow_array()) {
my $textbit = substr($text, 0, 55); my $textbit = substr($text, 0, 55);
if (length($text) > 55) { if (length($text) > 55) {
$textbit = $textbit . "..."; $textbit = $textbit . "...";
} }
my $genesispad = sprintf("%-10s", $genesis); my $portalpad = sprintf("%-10s", $portal);
print "$idx\t$genesispad $textbit\n" print "$idx\t$portalpad $textbit\n"
} }
} elsif ($retire_mode) { } elsif ($retire_mode) {
# #
...@@ -214,8 +214,8 @@ if ($add_mode) { ...@@ -214,8 +214,8 @@ if ($add_mode) {
DBQueryFatal("select count(*) from apt_announcement_info where dismissed=1 and aid=".DBQuoteSpecial($info_idx)); DBQueryFatal("select count(*) from apt_announcement_info where dismissed=1 and aid=".DBQuoteSpecial($info_idx));
my ($dismissed) = $query_result->fetchrow_array(); my ($dismissed) = $query_result->fetchrow_array();
$query_result = $query_result =
DBQueryFatal("select idx, created, uid_idx, genesis, retired, max_seen, text, style, link_label, link_url from apt_announcements where idx=".DBQuoteSpecial($info_idx)); DBQueryFatal("select idx, created, uid_idx, portal, retired, max_seen, text, style, link_label, link_url from apt_announcements where idx=".DBQuoteSpecial($info_idx));
if (my ($idx, $created, $uid_idx, $genesis, $retired, if (my ($idx, $created, $uid_idx, $portal, $retired,
$max_seen, $text, $style, $link_label, $max_seen, $text, $style, $link_label,
$link_url) = $query_result->fetchrow_array()) $link_url) = $query_result->fetchrow_array())
{ {
...@@ -223,7 +223,7 @@ if ($add_mode) { ...@@ -223,7 +223,7 @@ if ($add_mode) {
print "Details for announcement $idx\n"; print "Details for announcement $idx\n";
print "-----------------------------\n\n"; print "-----------------------------\n\n";
print "Created:\t$created\n"; print "Created:\t$created\n";
print "Genesis:\t$genesis\n\n"; print "Portal:\t$portal\n\n";
if (defined($link_label) && defined($link_url)) { if (defined($link_label) && defined($link_url)) {
print "Button Label:\t$link_label\n"; print "Button Label:\t$link_label\n";
print "Button URL:\t$link_url\n"; print "Button URL:\t$link_url\n";
......
...@@ -66,8 +66,8 @@ function Do_SearchUsers() ...@@ -66,8 +66,8 @@ function Do_SearchUsers()
return -1; return -1;
} }
$query_result = $query_result =
DBQueryFatal("select uid,usr_name,usr_affil,genesis from users ". DBQueryFatal("select uid,usr_name,usr_affil,portal from users ".
"where genesis='$PORTAL_GENESIS' and ". "where portal='$PORTAL_GENESIS' and ".
" (uid like '%${text}%' or ". " (uid like '%${text}%' or ".
" usr_name like '%${text}%') ". " usr_name like '%${text}%') ".
"order by uid"); "order by uid");
...@@ -103,10 +103,10 @@ function Do_SearchProjects() ...@@ -103,10 +103,10 @@ function Do_SearchProjects()
return -1; return -1;
} }
$query_result = $query_result =
DBQueryFatal("select pid,u.uid,u.usr_name,u.usr_affil,p.genesis ". DBQueryFatal("select pid,u.uid,u.usr_name,u.usr_affil,p.portal ".
" from projects as p ". " from projects as p ".
"left join users as u on u.uid_idx=p.head_idx ". "left join users as u on u.uid_idx=p.head_idx ".
"where p.genesis='$PORTAL_GENESIS' and ". "where p.portal='$PORTAL_GENESIS' and ".
" (pid like '%${text}%' or ". " (pid like '%${text}%' or ".
" u.usr_name like '%${text}%' or ". " u.usr_name like '%${text}%' or ".
" u.usr_affil like '%${text}%') ". " u.usr_affil like '%${text}%') ".
......
...@@ -437,7 +437,7 @@ function GET_ANNOUNCEMENTS($user) ...@@ -437,7 +437,7 @@ function GET_ANNOUNCEMENTS($user)
$uid_idx = $user->uid_idx(); $uid_idx = $user->uid_idx();
$dblink = DBConnect("tbdb"); $dblink = DBConnect("tbdb");
# Add an apt_announcement_info entry for any announcements which don't have one # Add an apt_announcement_info entry for any announcements which don't have one
$query_result = DBQueryWarn('select a.idx from apt_announcements as a left join apt_announcement_info as i on a.idx=i.aid and ((a.uid_idx is NULL and i.uid_idx="'.$uid_idx.'") or (a.uid_idx is not NULL and a.uid_idx=i.uid_idx)) where a.genesis="'.$PORTAL_GENESIS.'" and a.retired=0 and i.uid_idx is NULL and (a.uid_idx is NULL or a.uid_idx="'.$uid_idx.'")'); $query_result = DBQueryWarn('select a.idx from apt_announcements as a left join apt_announcement_info as i on a.idx=i.aid and ((a.uid_idx is NULL and i.uid_idx="'.$uid_idx.'") or (a.uid_idx is not NULL and a.uid_idx=i.uid_idx)) where a.portal="'.$PORTAL_GENESIS.'" and a.retired=0 and i.uid_idx is NULL and (a.uid_idx is NULL or a.uid_idx="'.$uid_idx.'")');
while ($row = mysql_fetch_array($query_result, MYSQL_NUM)) { while ($row = mysql_fetch_array($query_result, MYSQL_NUM)) {
DBQueryWarn('insert into apt_announcement_info set aid="'.$row[0].'", uid_idx="'.$uid_idx.'",seen_count=0'); DBQueryWarn('insert into apt_announcement_info set aid="'.$row[0].'", uid_idx="'.$uid_idx.'",seen_count=0');
} }
...@@ -446,7 +446,7 @@ function GET_ANNOUNCEMENTS($user) ...@@ -446,7 +446,7 @@ function GET_ANNOUNCEMENTS($user)
'from apt_announcements as a '. 'from apt_announcements as a '.
'left join apt_announcement_info as i on a.idx=i.aid '. 'left join apt_announcement_info as i on a.idx=i.aid '.
'where (a.uid_idx is NULL or a.uid_idx="'.$uid_idx.'") and '. 'where (a.uid_idx is NULL or a.uid_idx="'.$uid_idx.'") and '.
'a.retired = 0 and a.genesis="'.$PORTAL_GENESIS.'" and '. 'a.retired = 0 and a.portal="'.$PORTAL_GENESIS.'" and '.
'i.uid_idx="'.$uid_idx.'" and '. 'i.uid_idx="'.$uid_idx.'" and '.
'i.dismissed = 0 and i.clicked = 0 and '. 'i.dismissed = 0 and i.clicked = 0 and '.
'(a.max_seen = 0 or i.seen_count < a.max_seen)', $dblink); '(a.max_seen = 0 or i.seen_count < a.max_seen)', $dblink);
......
...@@ -150,7 +150,7 @@ function Do_ProjectProfile() ...@@ -150,7 +150,7 @@ function Do_ProjectProfile()
$results["pid"] = $target_project->pid(); $results["pid"] = $target_project->pid();
$results["pid_idx"] = $target_project->pid_idx(); $results["pid_idx"] = $target_project->pid_idx();
$results["leader"] = $target_project->head_uid(); $results["leader"] = $target_project->head_uid();
$results["genesis"] = $target_project->genesis(); $results["portal"] = $target_project->portal();
$results["created"] = DateStringGMT($target_project->created()); $results["created"] = DateStringGMT($target_project->created());
$results["approved"] = $target_project->approved(); $results["approved"] = $target_project->approved();
$results["url"] = $target_project->URL(); $results["url"] = $target_project->URL();
......
<?php <?php
# #
# Copyright (c) 2000-2015 University of Utah and the Flux Group. # Copyright (c) 2000-2016 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -419,7 +419,7 @@ if (!$this_user) { ...@@ -419,7 +419,7 @@ if (!$this_user) {
# Force initial SSL cert generation. # Force initial SSL cert generation.
$args["passphrase"] = $formfields["password1"]; $args["passphrase"] = $formfields["password1"];
# Flag to the backend. # Flag to the backend.
$args["genesis"] = $PORTAL_GENESIS; $args["portal"] = $PORTAL_GENESIS;
# #
# Backend verifies pubkey and returns error. We first look for a # Backend verifies pubkey and returns error. We first look for a
...@@ -517,7 +517,7 @@ $args["ron"] = 0; ...@@ -517,7 +517,7 @@ $args["ron"] = 0;
$args["funders"] = "None"; $args["funders"] = "None";
$args["whynotpublic"] = $PORTAL_GENESIS; $args["whynotpublic"] = $PORTAL_GENESIS;
# Flag to the backend. # Flag to the backend.
$args["genesis"] = $PORTAL_GENESIS; $args["portal"] = $PORTAL_GENESIS;
if (! ($project = Project::NewNewProject($args, $error))) { if (! ($project = Project::NewNewProject($args, $error))) {
$errors["error"] = $error; $errors["error"] = $error;
......
<?php <?php
# #
# Copyright (c) 2000-2015 University of Utah and the Flux Group. # Copyright (c) 2000-2016 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -61,7 +61,7 @@ if ($query_result) { ...@@ -61,7 +61,7 @@ if ($query_result) {
# #
$query_result = $query_result =
DBQueryFatal("select count(pid) from projects ". DBQueryFatal("select count(pid) from projects ".
"where approved=1 and genesis='cloudlab'"); "where approved=1 and portal='cloudlab'");
if ($query_result) { if ($query_result) {
$row = mysql_fetch_array($query_result); $row = mysql_fetch_array($query_result);
$blob["projects"] = $row[0]; $blob["projects"] = $row[0];
......
...@@ -21,10 +21,12 @@ ...@@ -21,10 +21,12 @@
<td>Created</td> <td>Created</td>
<td class="format-date"><%= fields.created %></td> <td class="format-date"><%= fields.created %></td>
</tr> </tr>
<% if (fields.portal) { %>
<tr> <tr>
<td>Genesis</td> <td>Portal</td>
<td><%= fields.genesis %></td> <td><%= fields.portal %></td>
</tr> </tr>
<% } %>
<tr> <tr>
<td>Approved</td> <td>Approved</td>
<td><% if (fields.approved) { %>Yes<% } else { %>No<% } %></td> <td><% if (fields.approved) { %>Yes<% } else { %>No<% } %></td>
......
...@@ -35,10 +35,12 @@ ...@@ -35,10 +35,12 @@
<td><%= fields.city %></td> <td><%= fields.city %></td>
</tr> </tr>
<% if (isadmin) { %> <% if (isadmin) { %>
<% if (fields.portal) { %>
<tr> <tr>
<td>Genesis</td> <td>Portal</td>
<td><%= fields.genesis %></td> <td><%= fields.portal %></td>
</tr> </tr>
<% } %>
<tr> <tr>
<td>Created</td> <td>Created</td>
<td class="format-date"><%= fields.created %></td> <td class="format-date"><%= fields.created %></td>
......
...@@ -165,7 +165,7 @@ function Do_AccountDetails() ...@@ -165,7 +165,7 @@ function Do_AccountDetails()
if (ISADMIN()) { if (ISADMIN()) {
$results["uid_idx"] = $target_user->uid_idx(); $results["uid_idx"] = $target_user->uid_idx();
$results["genesis"] = $target_user->genesis(); $results["portal"] = $target_user->portal();
$results["created"] = DateStringGMT($target_user->created()); $results["created"] = DateStringGMT($target_user->created());
$results["status"] = $target_user->status(); $results["status"] = $target_user->status();
$results["stud"] = $target_user->stud() ? true : false; $results["stud"] = $target_user->stud() ? true : false;
......
...@@ -726,7 +726,7 @@ class Group ...@@ -726,7 +726,7 @@ class Group
$usr_URL = $user->URL(); $usr_URL = $user->URL();
$url = $project->wwwBase(); $url = $project->wwwBase();
if (1 || if ($project->isEmulab() ||
$project->isAPT() || $project->isCloud() || $project->isPNet()) { $project->isAPT() || $project->isCloud() || $project->isPNet()) {
$url .= "/approveuser.php?uid=$joining_uid&pid=$pid"; $url .= "/approveuser.php?uid=$joining_uid&pid=$pid";
$message = $message =
......
...@@ -164,10 +164,18 @@ class Project ...@@ -164,10 +164,18 @@ class Project
function cvsrepo_public(){ return $this->field("cvsrepo_public"); } function cvsrepo_public(){ return $this->field("cvsrepo_public"); }
function allow_workbench(){ return $this->field("allow_workbench"); } function allow_workbench(){ return $this->field("allow_workbench"); }
function nonlocal_id() { return $this->field("nonlocal_id"); } function nonlocal_id() { return $this->field("nonlocal_id"); }
function genesis() { return $this->field("genesis"); } function portal() { return $this->field("portal"); }
function isAPT() { return $this->genesis() == "aptlab" ? 1 : 0; } function isAPT() { return ($this->portal() &&
function isCloud() { return $this->genesis() == "cloudlab" ? 1 : 0; } $this->portal() == "aptlab" ? 1 : 0); }
function isPNet() { return $this->genesis() == "phantomnet" ? 1 : 0; } function isCloud() { return ($this->portal() &&
$this->portal() == "cloudlab" ? 1 : 0); }
function isPNet() { return ($this->portal() &&
$this->portal() == "phantomnet" ? 1 : 0);}
function isEmulab() { return ($this->portal() &&
$this->portal() == "emulab" ? 1 : 0); }
# Not via the Portal interface.
function isClassic() { return ($this->portal() ? 0 : 1); }