Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a64deef
commit 5b17798
Showing
17 changed files
with
83 additions
and
22 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.openxava.naviox; | ||
|
||
import java.util.*; | ||
|
||
import javax.naming.*; | ||
import javax.naming.directory.*; | ||
|
||
import com.openxava.naviox.util.*; | ||
|
||
public class LDAPAuthenticator { | ||
|
||
public boolean authenticateUser(String username, String password, String userType) { | ||
|
||
String ldapURL = (String)NaviOXPreferences.getInstance().getLDAPConfiguration(userType).get("ldapURL"); | ||
String ldapBase = (String)NaviOXPreferences.getInstance().getLDAPConfiguration(userType).get("ldapBase"); | ||
String dn = "uid=" + username + "," + ldapBase; | ||
Hashtable<String, String> environment = new Hashtable<String, String>(); | ||
environment.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); | ||
environment.put(Context.PROVIDER_URL, ldapURL); | ||
environment.put(Context.SECURITY_AUTHENTICATION, "simple"); | ||
environment.put(Context.SECURITY_PRINCIPAL, dn); | ||
environment.put(Context.SECURITY_CREDENTIALS, password); | ||
|
||
try { | ||
DirContext authContext = new InitialDirContext(environment); | ||
return true; | ||
|
||
} catch (AuthenticationException ex) { | ||
ex.printStackTrace(); | ||
return false; | ||
} | ||
|
||
catch (NamingException ex) { | ||
ex.printStackTrace(); | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,41 @@ | ||
<%-- <%@page import="com.openxava.phone.web.Browsers"%> --%> | ||
<%-- <%@page import="org.openxava.util.Users"%> --%> | ||
|
||
<%-- <jsp:useBean id="modules" class="com.openxava.naviox.Modules" scope="session"/> --%> | ||
|
||
<%-- | ||
Users.setCurrent(request); | ||
// String module = Users.getCurrent() == null?"SignIn":modules.getCurrent(request); | ||
// String url = Browsers.isMobile(request)?"phone":"m/" + module; | ||
--%> | ||
|
||
<!-- <script type="text/javascript"> --> | ||
<%-- window.location="<%=url%>"; --%> | ||
<!-- </script> --> | ||
|
||
<%@page import="com.openxava.naviox.util.Organizations"%> | ||
<%@page import="com.openxava.phone.web.Browsers"%> | ||
<%@page import="org.openxava.util.Users"%> | ||
|
||
<jsp:useBean id="modules" class="com.openxava.naviox.Modules" scope="session"/> | ||
|
||
<% | ||
Users.setCurrent(request); | ||
String module = Users.getCurrent() == null?"SignIn":modules.getCurrent(request); | ||
String url = Browsers.isMobile(request)?"phone":"m/" + module; | ||
if (Users.getCurrent() != null || Organizations.getCurrent(request) != null) { | ||
String module = Users.getCurrent() == null?"SignIn":modules.getCurrent(request); | ||
String url = Browsers.isMobile(request) && !"Index".equals(modules.getCurrent(request))?"phone":"m/" + module; | ||
%> | ||
|
||
<script type="text/javascript"> | ||
window.location="<%=url%>"; | ||
</script> | ||
|
||
<% | ||
} | ||
else { | ||
%> | ||
<jsp:include page="naviox/welcome.jsp"/> | ||
<% | ||
} | ||
%> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1 @@ | ||
<%@include file="../xava/imports.jsp"%> | ||
|
||
<%-- To put your own text add entries in the i18n messages files of your project --%> | ||
|
||
<% | ||
String language = "es".equals(request.getLocale().getLanguage()) || "ca".equals(request.getLocale().getLanguage())?"es":"en"; | ||
%> | ||
|
||
<div id="first_steps"> | ||
<p><xava:message key="first_steps_p1"/></p> | ||
<p class="screenshot"><img src="../naviox/images/modules-screenshot_<%=language%>.png"/></p> | ||
<p><xava:message key="first_steps_p2"/></p> | ||
<p class="screenshot"><img src="../naviox/images/list-mode-screenshot_<%=language%>.png"/></p> | ||
<p><xava:message key="first_steps_p3"/></p> | ||
</div> | ||
<jsp:forward page="/m/TodayAgendaRequest"></jsp:forward> |