; string currentUser = System.Web.HttpContext.Current.Session["CurrentUser"].ToString();
// Get the admin user id from config file.
string adminUser = System.Configuration.ConfigurationSettings.AppSettings["AdminUser"];
if ( currentUser == adminUser )
{
// Current user is an administrator. Administrator is Owner for all submissions.
return true;
}
return false;
}
public static string FormatFileName(string s)
{
char chars = {''#'', ''@'', ''?'', '':'', ''\'''', ''\"'', ''.'', ''/'', ''\\'', '' '', ''<'', ''>'', ''&'', ''*'', ''('', '')'', ''!'', '','', '';'', '':'', ''-'', ''+'', ''=''};
foreach (char c in chars)
{
s = s.Replace(c, ''-'');
}
s = s.Replace(" ", "-");
s = s.Replace("--", "-");
if ( s.LastIndexOf("-") == (s.Length - 1) && s.Length > 2 )
{
s = s.Substring(0, s.Length - 1);
}