Fixes the anonymous profile usage
* NpgsqlMembershipProvider.cs: insert a profile record before inserting the users record, to ensure a new foreign key constraint * NpgsqlProfileProvider.cs: better comments * YavscController.cs: Fixes the cookies agreement * HomeController.cs: Finalizes the cookie agreement system. * YavscHelpers.cs: Adds a "click_action_name" field, to give a text to the notification dimissing button. * App.master: Uses the new field from Notification * Web.config: No VB code to compile * Web.csproj: moves Sql files to Sql folder * LocalizedText.resx: * LocalizedText.fr.resx: * LocalizedText.Designer.cs: * LocalizedText.fr.Designer.cs: I understood ... * Notification.cs: a new click action name. * instdbws.sql: permits profile records with no users record associated to, and so, anonymous profiles creation.
This commit is contained in:
parent
e6c65019b0
commit
cbb596ca04
17 changed files with 104 additions and 46 deletions
|
|
@ -24,21 +24,6 @@ namespace Yavsc.Controllers
|
|||
/// </summary>
|
||||
public class HomeController : Controller
|
||||
{
|
||||
// Site name
|
||||
private static string name = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the site name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
[Obsolete("Use YavscHelpers.SiteName insteed.")]
|
||||
public static string Name {
|
||||
get {
|
||||
if (name == null)
|
||||
name = WebConfigurationManager.AppSettings ["Name"];
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lists the referenced assemblies.
|
||||
|
|
@ -87,16 +72,15 @@ namespace Yavsc.Controllers
|
|||
/// </summary>
|
||||
public ActionResult Index ()
|
||||
{
|
||||
var anonid = Request.AnonymousID;
|
||||
if (Session.IsNewSession) {
|
||||
if (!Request.IsAuthenticated) {
|
||||
ProfileBase anonymousProfile = ProfileBase.Create(anonid);
|
||||
object ac = anonymousProfile.GetPropertyValue ("allowcookies");
|
||||
|
||||
if (ac is string && ((string)ac)!="true")
|
||||
YavscHelpers.Notify (ViewData, LocalizedText.ThisSiteUsesCookies,
|
||||
"function(){Yavsc.ajax(\"/Yavsc/AllowCookies\", { id:'"+anonid+"' });}");
|
||||
}
|
||||
string uid = (!Request.IsAuthenticated) ? Request.AnonymousID : User.Identity.Name;
|
||||
ProfileBase pr =
|
||||
ProfileBase.Create (uid);
|
||||
bool ac = (bool) pr.GetPropertyValue ("allowcookies");
|
||||
if (!ac)
|
||||
YavscHelpers.Notify (ViewData, LocalizedText.ThisSiteUsesCookies,
|
||||
"function(){Yavsc.ajax(\"/Yavsc/AllowCookies\", { id:'"+uid+"' });}",
|
||||
LocalizedText.I_understood);
|
||||
}
|
||||
|
||||
foreach (string tagname in new string[] {"Accueil","Événements","Mentions légales"})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue