DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Help, missing permission on login

 7 Replies
 1 Subscribed to this topic
 40 Subscribed to this forum
Sort:
Author
Messages
Growing Member
Posts: 38
Growing Member

Hi, created a custom login page on a parent portal,  set the site settings to use it but silly forgot to set all user permissions on the page.. now I cannot log in.

Is there a way to set permission via the sql database and if so where and how?

Veteran Member
Posts: 1246
Veteran Member
MVP
MVP
You're an MVP!
You should be able to go to the Page Management page or Persona Bar item, locate the custom page, and edit page settings. That includes permissions. There's no need to get into the database.
Growing Member
Posts: 38
Growing Member
Hi Joe, I cannot login to that portal, so no way to access the page settings.
Veteran Member
Posts: 1246
Veteran Member
MVP
MVP
You're an MVP!
Oh, duh!

Does appending ?ctl=login to the url for the site work?
Growing Member
Posts: 38
Growing Member

No manual login does not work either Joe, even though I was able to login as host via another portal and in host site settings for the offending portal remove the link for login page back to "not specified" restarted IIS and recycled app pool but it still does not work.

That's why I hoped it can be done via SQL, it must be a common mistake so was hoping someone has a query or can point out any steps to take. As it is a multi portal instance (12 websites) I am anxious not to cause a domino effect.

I saw a post where it was mentioned to set the custom login page I created to deleted by marking the "IsDeleted" flag in the TabModules table.
then restart everything and all should come up correctly and the portal should revert to the generic default login. Is that worth a go??

Veteran Member
Posts: 1246
Veteran Member
MVP
MVP
You're an MVP!
Yes, logging in to another portal works. In fact, it might be a decent idea to create a separate portal that you can use for logging in if something like this happens again.

Yes, you can do this in SQL. I've never done it, though.

I would have looked for the setting that points to the custom login page, though, and set it to the default.
Growing Member
Posts: 38
Growing Member
I thought of that also, but could not find any path that links to a default login, the Tabpath is //login. So tried flagging it as deleted, thinking it would simply revert to default but did not work either. I was wondering if I should try inserting a new permission row into TabPermission with correct tabid, role etc ???
Growing Member
Posts: 38
Growing Member

In case someone is still trying to find a solution, this was a fix for me. You need CRUD access to the database either through the SQL tool in Host or SQL Management Studio.

We need to add a role to the TabPermissions table to configure the offending "Login" page to be accessible by "unauthenticated users".  It will not work with "All Users" permission as the users have not authenticated themselves before they try to access login.

Don't forget to backup your site and database first, just in case. I cannot guarantee this will work for everyone. it is worth checking all columns exists and bring back a result in a select, before running an update

1. Find the tabID of the login page (you can use this handy little script).
SELECT portalID, TabID, TabName, Title, TabPath, IsVisible AS InMenu, IsSecure, SkinSrc, ContainerSrc,
    SUBSTRING((  
    SELECT '; ' 
      + ISNULL(r.RoleName, CONVERT(NVARCHAR, tp.RoleID)) + ' [' 
      + SUBSTRING((
          SELECT ', ' + PermissionName 
          FROM TabPermission tpSub 
          INNER JOIN Permission p 
            ON p.PermissionID = tpSub.PermissionID
          WHERE tpSub.TabID = tp.TabID 
            AND tpSub.RoleID = tp.RoleID
          FOR XML PATH('')), 
        3, 1000)
      + ']'
    FROM TabPermission tp
    LEFT OUTER JOIN 
      (SELECT RoleID, RoleName FROM Roles
      UNION ALL SELECT -1, 'All Users'
      UNION ALL SELECT -2, 'Registered'
      UNION ALL SELECT -3, 'Unauthorized') r 
        ON tp.RoleID = r.RoleID

    WHERE tp.TabPermissionID IN
      (SELECT MIN(TabPermissionID) 
      FROM  TabPermission tpMin 
      WHERE tpMin.TabID = Tabs.TabID
      GROUP BY tpMin.RoleID
      )
    ORDER BY tp.RoleID
    FOR XML PATH('')), 3, 1000) AS Permissions
FROM Tabs
WHERE PortalID in(0) //replace with portal id

--and tabid in()
AND IsDeleted = 0
ORDER BY TabPath

2. Once you have the tabID amend and run the following Update.
UPDATE tabpermission SET RoleID = -3 WHERE tabID = "YourTabID" AND PermissionID = 3

The login page will be accessible now,  so login and update the permissions as required for the login page

 

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved