0

SimpleSAML - SQLServer Connection

'sqlserver' => [
'sqlauth:SQL',
'dsn' => 'sqlsrv:Server=[server host / ip],1433;Database=[dbname]',
'username' => '[userid]',
'password' => '[password]',
'hash_column' => 'password',
'query' => 'SELECT users.uid, name AS cn, email AS mail,password FROM users WHERE users.email = :username',
'pepper' => '',
],
0

SimpleSAML and Active Directory configuration

References:

In config/authsources.php change example-ldap to the desired configuration

'example-ldap' =[
'ldap:LDAP',
hostname' = 'host.domain.com',
'enable_tls' = FALSE,
'debug' = TRUE,
'port' = 389,
'timeout' = 10,
'referrals' = FALSE,
'dnpattern' = 'sAMAccountName=%username%,ou=users,dc=company,dc=com',
'search.enable' = TRUE,
'search.base' = 'OU=users,DC=company,DC=com',
'search.attributes' = array('samAccountName'),
'search.username' = 'CN=yourname,OU=Users,DC=company,DC=Com',
'search.password' = ' ***** ',
'priv.read' = TRUE,
'priv.username' = '',
'priv.password' = '****'
]
0

Bootstrap 4 Datetime Picker With Custom Format Initialization

I had several date time picker with custom format (yyyy-MM-dd hh:mm:ss) in a page and don't want to initialize each element manually.

https://tempusdominus.github.io/bootstrap-4/
0

JQuery - textarea with character remaining using maxlength attribute

I want a simple solution to add the current text area with the remaining characters displayed without having to manually add counting elements.
0

GXT 3 - DateField date selection in a month

I want make the datefield to just allow selection in a month only.


DateField dateField = new DateField(new DateTimePropertyEditor(DateTimeFormat.getFormat("dd-MMM-yyyy")));

String sDate=session.getIps_year().toString() + "-" + session.getIps_month().toString() + "-01";        
Date mindate =Application.mysqlDateTimeFormat.parse(sDate);
dateField.setMinValue(mindate);    
dateField.getDatePicker().setMinDate(mindate);

Date maxdDate=CalendarUtil.copyDate(mindate);
CalendarUtil.addMonthsToDate(maxdDate, 1);
int days= CalendarUtil.getDaysBetween(mindate, maxdDate);
maxdDate=CalendarUtil.copyDate(mindate);
CalendarUtil.addDaysToDate(maxdDate, days-1);
dateField.setMaxValue(maxdDate);    
dateField.getDatePicker().setMaxDate(maxdDate);

0

GXT 3 Date Field Min & Max Date

I want to set min dan max date for datefield and want it disable the selection of dates out of specified range.

DateField dateField = new DateField(new DateTimePropertyEditor(DateTimeFormat.getFormat("dd-MMM-yyyy")));
dateField.getDatePicker().setMinDate(mindate);
dateField.getDatePicker().setMaxDate(maxdDate);
        
0

ASP.NET - Handling Form Submit on Enter Key Pressed

Source : http://weblog.kevinattard.com/2011/08/aspnet-disable-submit-form-on-enter-key.html

Actually I'm new to ASP.NET. This is my first attempt to develop a system that uses ASP.NET. It is not very difficult but there are some annoying things that need to be addressed. One of them is when the enter key is pressed, the form will be submitted, but logic is not triggered as it should be.

The steps are as follows:

1. In my case, I wrapped all the form content into an updatepanel.
2. Set the DefaultButton attribute of updatepanel to a button (it can be visible one, depends on your appplication)
3. Handle the logic.

Done. Tada.....

 
Copyright © peyotest