AUTHENTICATE 2 LDAP USER IN ITOPS - ldap

I have some LDAP users in iTops, and i want to login with all of users in iTops. But i have an error like that "user not found in LDAP".
Which folders that i have to change ? So i can login with all LDAP users.
I appreciate for your responses, all of you. Please help me, thanks.
in config-itop.php
$MyModuleSettings = array(
'authent-ldap' => array (
'host' => '192.168.1.2',
'port' => 389,
'default_user' => 'anonim',
'default_pwd' => 'Admin123',
'base_dn' => 'dc=vokasiub,dc=COM',
'user_query' => '(samaccountname=%1$s)',
'options' => array (
17 => 3,
8 => 0,
),
'start_tls' => false,
'debug' => true,
),
'authent-ldap2' => array (
'host' => '192.168.2.2',
'port' => 389,
'default_user' => 'isoiso',
'default_pwd' => 'Admin123',
'base_dn' => 'ou=users ou, dc=bagusyekti,dc=COM',
'user_query' => '(samaccountname=%1$s)',
'options' => array (
17 => 3,
8 => 0,
),
'start_tls' => false,
'debug' => true,
),
'itop-attachments' => array (
'allowed_classes' => array (
0 => 'Ticket',
),
'position' => 'relations',
'preview_max_width' => 290,
),
'email-reply' => array (
'enabled_default' => true,
),
'itop-backup' => array (
'mysql_bindir' => '',
'week_days' => 'monday, tuesday, wednesday, thursday, friday',
'time' => '23:30',
'retention_count' => 5,
'enabled' => true,
'debug' => true,
),
);

iTop 2.7 and older
This was not possible.
iTop 3.0 and newer
This is now possible, check the full documentation here, but basically you have to set the different LDAP servers like this in the iTop configuration file:
'authent-ldap' => array (
'host' => 'localhost',
'port' => 389,
'default_user' => '',
'default_pwd' => '',
'base_dn' => 'dc=mycompany,dc=com',
'user_query' => '(&(uid=%1$s))',
'options' => array (
17 => 3,
8 => 0,
),
'debug' => false,
'servers' => array(
'MySecond-LDAP-Server' => array(
'host' => 'server1',
'port' => 389,
'default_user' => '',
'default_pwd' => '',
'base_dn' => 'dc=mycompany,dc=com',
'user_query' => '(&(uid=%1$s))',
'options' => array (
17 => 3,
8 => 0,
),
'debug' => false,
),
),
),

Related

Omit language preVar for RealURL 2.x with multidomain-multilanguage setup?

In a TYPO3 6.2.30 site, I updated RealURL 1.x to 2.2.1.
It works fine, but it is a multilanguage-multidomain site that doesn't require the language prefix after the domain.
Before I had
www.germandomain.ch/seite
www.frenchdomain.ch/page
Now I get
www.germandomain.ch/de/seite
www.frenchdomain.ch/fr/page
The old paths are still working as an alternative though.
How can I omit the parameter from the URL for both languages - is that still possible with RealURL 2?
Below are the relevant configuration snippets. I don't have domain records defined in the backend / pagetree.
'preVars' => array(
array(
'GETvar' => 'L',
'valueMap' => array(
'de' => '0',
'fr' => '1',
),
//'valueDefault' => 'de',
'noMatch' => 'bypass',
),
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'no_cache' => 1,
),
'noMatch' => 'bypass',
),
),
and
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DOMAINS'] = array(
'encode' => array(
array(
'GETvar' => 'L',
'value' => '',
'ifDifferentToCurrent' => true,
'useConfiguration' => '_DEFAULT',
'urlPrepend' => 'https://www.germandomain.ch',
),
array(
'GETvar' => 'L',
'value' => '0',
'ifDifferentToCurrent' => true,
'useConfiguration' => '_DEFAULT',
'urlPrepend' => 'https://www.germandomain.ch',
),
array(
'GETvar' => 'L',
'value' => '1',
'ifDifferentToCurrent' => true,
'useConfiguration' => '_DEFAULT',
'urlPrepend' => 'https://www.frenchdomain.ch',
),
),
'decode' => array(
'www.germandomain.ch' => array(
'GETvars' => array(
'L' => '0',
),
'useConfiguration' => '_DEFAULT',
),
'www.frenchdomain.ch' => array(
'GETvars' => array(
'L' => '1',
),
'useConfiguration' => '_DEFAULT',
),
),
);
and in TS
config {
sys_language_uid = 0
linkVars = L
language = de
locale_all = de_DE.utf-8
htmlTag_langKey = de
#defaultGetVars.L = 0
}
[globalVar = GP:L = 1]
config {
sys_language_uid = 1
language = fr
locale_all = fr_FR.utf-8
htmlTag_langKey = fr
#defaultGetVars.L = 1
}
[global]

Sylius - How to add a custom promotion action?

I have followed the tutorial listed [enter link description here.
However, when i try to add a promotion with this action, i get this error:
Could not load type "AppBundle\Promotion\Action\CheapestProductDiscountPromotionActionCommand"
Upon further investigation, CheapestProductDiscountPromotionActionCommand.php goes through the following code block in FormRegistry.php:
if (class_exists($name) && in_array('Symfony\Component\Form\FormTypeInterface', class_implements($name))) {
$type = new $name();
} else {
throw new InvalidArgumentException(sprintf('Could not load type "%s"', $name));
}
From what i can gather, it is checking if CheapestProductDiscountPromotionActionCommand.php implements FormTypeInterface but Im not entirely sure why? I thought CheapestProductDiscountConfigurationType extends AbstractType which implements FormTypeInterface? Maybe Im wrong but i would of thought that CheapestProductDiscountPromotionActionCommand.php should not be going through the above code block?
My stack trace is as follows:
Stack Trace
in vendor/symfony/symfony/src/Symfony/Component/Form/FormRegistry.php at line 87 +
at FormRegistry ->getType ('AppBundle\\Promotion\\Action\\CheapestProductDiscountPromotionActionCommand')
in vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php at line 83 +
at FormFactory ->createNamedBuilder ('UK_WEB', 'AppBundle\\Promotion\\Action\\CheapestProductDiscountPromotionActionCommand', array(), array('auto_initialize' => false, 'label' => 'UK Web Store', 'currency' => 'GBP'))
in vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php at line 47 +
at FormFactory ->createNamed ('UK_WEB', 'AppBundle\\Promotion\\Action\\CheapestProductDiscountPromotionActionCommand', array(), array('auto_initialize' => false, 'label' => 'UK Web Store', 'currency' => 'GBP'))
in vendor/sylius/sylius/src/Sylius/Bundle/CoreBundle/Form/EventSubscriber/BuildChannelBasedPromotionActionFormSubscriber.php at line 114 +
at BuildChannelBasedPromotionActionFormSubscriber ->createConfigurationFieldForChannel (object(Channel), 'AppBundle\\Promotion\\Action\\CheapestProductDiscountPromotionActionCommand', array())
in vendor/sylius/sylius/src/Sylius/Bundle/CoreBundle/Form/EventSubscriber/BuildChannelBasedPromotionActionFormSubscriber.php at line 74 +
at BuildChannelBasedPromotionActionFormSubscriber ->addConfigurationFields (object(Form), 'cheapest_product_discount', array())
in vendor/sylius/sylius/src/Sylius/Bundle/PromotionBundle/Form/EventListener/AbstractConfigurationSubscriber.php at line 72 +
at AbstractConfigurationSubscriber ->preSetData (object(FormEvent), 'form.pre_set_data', object(EventDispatcher))
at call_user_func (array(object(BuildChannelBasedPromotionActionFormSubscriber), 'preSetData'), object(FormEvent), 'form.pre_set_data', object(EventDispatcher))
in vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php at line 174 +
at EventDispatcher ->doDispatch (array(array(object(BuildChannelBasedPromotionActionFormSubscriber), 'preSetData')), 'form.pre_set_data', object(FormEvent))
in vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php at line 43 +
at EventDispatcher ->dispatch ('form.pre_set_data', object(FormEvent))
in vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php at line 43 +
at ImmutableEventDispatcher ->dispatch ('form.pre_set_data', object(FormEvent))
in vendor/symfony/symfony/src/Symfony/Component/Form/Form.php at line 341 +
at Form ->setData (null)
in vendor/symfony/symfony/src/Symfony/Component/Form/Form.php at line 477 +
at Form ->initialize ()
in vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php at line 226 +
at FormBuilder ->getForm ()
in vendor/sylius/sylius/src/Sylius/Bundle/PromotionBundle/Form/Type/Core/AbstractConfigurationCollectionType.php at line 54 +
at AbstractConfigurationCollectionType ->buildForm (object(FormBuilder), array('block_name' => null, 'disabled' => false, 'label_format' => null, 'translation_domain' => null, 'auto_initialize' => true, 'trim' => true, 'required' => true, 'property_path' => null, 'mapped' => true, 'by_reference' => false, 'inherit_data' => false, 'compound' => true, 'method' => 'POST', 'action' => '', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'error_mapping' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'csrf_token_manager' => object(CsrfTokenManager), 'csrf_token_id' => null, 'allow_add' => true, 'allow_delete' => true, 'prototype' => true, 'prototype_data' => null, 'prototype_name' => '__name__', 'entry_type' => 'Sylius\\Bundle\\PromotionBundle\\Form\\Type\\PromotionActionType', 'delete_empty' => false, 'button_delete_label' => 'sylius.form.collection.delete', 'label' => 'sylius.form.promotion.actions', 'attr' => array(), 'data_class' => null, 'empty_data' => object(Closure), 'error_bubbling' => true, 'label_attr' => array(), 'upload_max_size_message' => object(Closure), 'validation_groups' => null, 'constraints' => array(), 'entry_options' => array('block_name' => 'entry'), 'button_add_label' => 'sylius.form.promotion.add_action'))
in vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php at line 126 +
at ResolvedFormType ->buildForm (object(FormBuilder), array('block_name' => null, 'disabled' => false, 'label_format' => null, 'translation_domain' => null, 'auto_initialize' => true, 'trim' => true, 'required' => true, 'property_path' => null, 'mapped' => true, 'by_reference' => false, 'inherit_data' => false, 'compound' => true, 'method' => 'POST', 'action' => '', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'error_mapping' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'csrf_token_manager' => object(CsrfTokenManager), 'csrf_token_id' => null, 'allow_add' => true, 'allow_delete' => true, 'prototype' => true, 'prototype_data' => null, 'prototype_name' => '__name__', 'entry_type' => 'Sylius\\Bundle\\PromotionBundle\\Form\\Type\\PromotionActionType', 'delete_empty' => false, 'button_delete_label' => 'sylius.form.collection.delete', 'label' => 'sylius.form.promotion.actions', 'attr' => array(), 'data_class' => null, 'empty_data' => object(Closure), 'error_bubbling' => true, 'label_attr' => array(), 'upload_max_size_message' => object(Closure), 'validation_groups' => null, 'constraints' => array(), 'entry_options' => array('block_name' => 'entry'), 'button_add_label' => 'sylius.form.promotion.add_action'))
in vendor/symfony/symfony/src/Symfony/Component/Form/Extension/DataCollector/Proxy/ResolvedTypeDataCollectorProxy.php at line 102 +
at ResolvedTypeDataCollectorProxy ->buildForm (object(FormBuilder), array('block_name' => null, 'disabled' => false, 'label_format' => null, 'translation_domain' => null, 'auto_initialize' => true, 'trim' => true, 'required' => true, 'property_path' => null, 'mapped' => true, 'by_reference' => false, 'inherit_data' => false, 'compound' => true, 'method' => 'POST', 'action' => '', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'error_mapping' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'csrf_token_manager' => object(CsrfTokenManager), 'csrf_token_id' => null, 'allow_add' => true, 'allow_delete' => true, 'prototype' => true, 'prototype_data' => null, 'prototype_name' => '__name__', 'entry_type' => 'Sylius\\Bundle\\PromotionBundle\\Form\\Type\\PromotionActionType', 'delete_empty' => false, 'button_delete_label' => 'sylius.form.collection.delete', 'label' => 'sylius.form.promotion.actions', 'attr' => array(), 'data_class' => null, 'empty_data' => object(Closure), 'error_bubbling' => true, 'label_attr' => array(), 'upload_max_size_message' => object(Closure), 'validation_groups' => null, 'constraints' => array(), 'entry_options' => array('block_name' => 'entry'), 'button_add_label' => 'sylius.form.promotion.add_action'))
in vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php at line 89 +
at FormFactory ->createNamedBuilder ('actions', 'Sylius\\Bundle\\PromotionBundle\\Form\\Type\\PromotionActionCollectionType', null, array('label' => 'sylius.form.promotion.actions', 'button_add_label' => 'sylius.form.promotion.add_action'))
in vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php at line 106 +
at FormBuilder ->create ('actions', 'Sylius\\Bundle\\PromotionBundle\\Form\\Type\\PromotionActionCollectionType', array('label' => 'sylius.form.promotion.actions', 'button_add_label' => 'sylius.form.promotion.add_action'))
in vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php at line 269 +
at FormBuilder ->resolveChildren ()
in vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php at line 215 +
at FormBuilder ->getForm ()
in vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php at line 39 +
at FormFactory ->create ('Sylius\\Bundle\\PromotionBundle\\Form\\Type\\PromotionType', object(Promotion), array())
in vendor/sylius/sylius/src/Sylius/Bundle/ResourceBundle/Controller/ResourceFormFactory.php at line 44 +
at ResourceFormFactory ->create (object(RequestConfiguration), object(Promotion))
in vendor/sylius/sylius/src/Sylius/Bundle/ResourceBundle/Controller/ResourceController.php at line 245 +
at ResourceController ->createAction (object(Request))
at call_user_func_array (array(object(ResourceController), 'createAction'), array(object(Request)))
in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php at line 153 +
at HttpKernel ->handleRaw (object(Request), 1)
in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php at line 68 +
at HttpKernel ->handle (object(Request), 1, true)
in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php at line 168 +
at Kernel ->handle (object(Request))
in web/app_dev.php at line 43 +
at require ('/Users/camerona/Documents/Projects/CheshireRaw/web/app_dev.php')
in vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/router_dev.php at line 40 +
I found the issue in CheapestProductDiscountPromotionActionCommand.
In the sylius documentation listed here:
/**
* {#inheritdoc}
*/
public function getConfigurationFormType()
{
return CheapestProductDiscountPromotionActionCommand::class;
}
However this should be:
/**
* {#inheritdoc}
*/
public function getConfigurationFormType()
{
return CheapestProductDiscountConfigurationType::class;
}
This is why the code checked that CheapestProductDiscountPromotionActionCommand.php implements FormTypeInterface.
Ive managed to add my custom action and its working perfectly. There is a couple of issues with the sylius documentation but the implementation works :).

ZF2 Child routes for restful API

I'm having some troubles setting up the routes for my restful api in zend framework2. I want to create route in this format: api-rest/wall/user_id/post[/:id].
Now this is my config file:
'router' => array(
'routes' => array(
'api-rest' => array(
'type' => 'segment',
'options' => array(
'route' => '/api-rest/wall[/:id]',
'constraints' => array(
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'ApiRest\Controller\Wall',
),
),
),
),
),
You can try something like this:
'router' => array(
'routes' => array(
'api-rest' => array(
'type' => 'segment',
'options' => array(
'route' => '/api-rest/wall/:userid/posts[/:id]',
'constraints' => array(
'id' => '[0-9]+',
'userid' => '[0-9]+',
),
'defaults' => array(
'controller' => 'ApiRest\Controller\Wall',
),
),
),
),
),
In this configuration userid is mandatory, not optional.
/api-rest/wall/3/posts/2 - Post with id 2 and user with id 3
/api-rest/wall/3/posts - All posts by user with id 3
/api-rest/wall/3 - Won't match
You may also want to take a look child route usage in routing documentation.

siteId 16617 not returning expected results with jsonsdk/DataService/getItemSummariesForSite API

I am following the pattern described in the manual.
Specifically, at step 5 when a user supplies incorrect credentials, step 6 should return feedback specifying bad user credentials.
I am calling jsonsdk/SiteAccountManagement/addSiteAccount1 with the following params:
array (
'cobSessionToken' => 'REDACTED',
'enclosedType' => 'com.yodlee.common.FieldInfoSingle',
'userSessionToken' => 'REDACTED',
'credentialFields.enclosedType' => 'com.yodlee.common.FieldInfoSingle',
'siteId' => '16617',
'credentialFields[0].valueIdentifier' => 'LOGIN',
'credentialFields[0].valueMask' => 'LOGIN_FIELD',
'credentialFields[0].fieldType.typeName' => 'IF_LOGIN',
'credentialFields[0].size' => '19',
'credentialFields[0].name' => 'LOGIN',
'credentialFields[0].displayName' => 'Card/Access Number',
'credentialFields[0].isEditable' => 'true',
'credentialFields[0].value' => 'BAD',
'credentialFields[1].valueIdentifier' => 'PASSWORD',
'credentialFields[1].valueMask' => 'LOGIN_FIELD',
'credentialFields[1].fieldType.typeName' => 'IF_PASSWORD',
'credentialFields[1].size' => '7',
'credentialFields[1].name' => 'PASSWORD',
'credentialFields[1].displayName' => 'Security Number',
'credentialFields[1].isEditable' => 'true',
'credentialFields[1].value' => 'BAD',
'credentialFields[2].valueIdentifier' => 'PASSWORD1',
'credentialFields[2].valueMask' => 'LOGIN_FIELD',
'credentialFields[2].fieldType.typeName' => 'IF_PASSWORD',
'credentialFields[2].size' => '12',
'credentialFields[2].name' => 'PASSWORD1',
'credentialFields[2].displayName' => 'Internet Password',
'credentialFields[2].isEditable' => 'true',
'credentialFields[2].value' => 'BAD',
'credentialFields[3].valueIdentifier' => 'OPTION',
'credentialFields[3].valueMask' => 'LOGIN_FIELD',
'credentialFields[3].fieldType.typeName' => 'OPTIONS',
'credentialFields[3].size' => '20',
'credentialFields[3].name' => 'OPTION',
'credentialFields[3].displayName' => 'Issue Number ',
'credentialFields[3].isEditable' => 'true',
'credentialFields[3].value' => '2',
)
It is returning:
array (
'siteAccountId' => 10381802,
'isCustom' => false,
'credentialsChangedTime' => 1412058909,
'siteRefreshInfo' =>
array (
'siteRefreshStatus' =>
array (
'siteRefreshStatusId' => 1,
'siteRefreshStatus' => 'REFRESH_TRIGGERED',
),
'siteRefreshMode' =>
array (
'refreshModeId' => 2,
'refreshMode' => 'NORMAL',
),
'updateInitTime' => 1412058909,
'nextUpdate' => 1412059809,
'code' => 801,
'suggestedFlow' =>
array (
'suggestedFlowId' => 2,
'suggestedFlow' => 'REFRESH',
),
'noOfRetry' => 0,
),
'siteInfo' =>
array (
'popularity' => 0,
'siteId' => 16617,
'orgId' => 9006,
'defaultDisplayName' => 'Bank of Melbourne (Australia)',
'defaultOrgDisplayName' => 'Bank of Melbourne',
'enabledContainers' =>
array (
0 =>
array (
'containerName' => 'bills',
'assetType' => 0,
),
),
'baseUrl' => 'http://www.bankofmelbourne.com.au/',
'loginForms' =>
array (
),
'isHeld' => false,
'isCustom' => false,
'siteSearchVisibility' => true,
),
'created' => '2014-09-29T23:35:09-0700',
'retryCount' => 0,
)
I am then extracting the 'siteAccountId' field and expect to eventually receive a notification of the bad credentials.
Here is a log of the consecutive calls to jsonsdk/DataService/getItemSummariesForSite, the responses and timestamps.
Attempt 1 Sent(2014-09-30 17:21:23):
array (
'cobSessionToken' => 'REDACTED',
'memSiteAccId' => 10381802,
'userSessionToken' => 'REDACTED'
)
Attempt 1 Received:
array (
'key' =>
array (
),
)
Attempt 2 Sent(2014-09-30 17:21:34):
array (
'cobSessionToken' => 'REDACTED',
'memSiteAccId' => 10381802,
'userSessionToken' => 'REDACTED'
)
Attempt 2 Received:
array (
'key' =>
array (
),
)
Attempt 3 Sent(2014-09-30 17:21:55):
array (
'cobSessionToken' => 'REDACTED',
'memSiteAccId' => 10381802,
'userSessionToken' => 'REDACTED'
)
Attempt 3 Received:
array (
'key' =>
array (
),
)
Attempt 4 Sent(2014-09-30 17:22:16):
array (
'cobSessionToken' => 'REDACTED',
'memSiteAccId' => 10381802,
'userSessionToken' => 'REDACTED'
)
Attempt 4 Received:
array (
'key' =>
array (
),
)
Attempt 5 Sent(2014-09-30 17:22:38):
array (
'cobSessionToken' => 'REDACTED',
'memSiteAccId' => 10381802,
'userSessionToken' => 'REDACTED'
)
Attempt 5 Received:
array (
'key' =>
array (
),
)
Attempt 6 Sent(2014-09-30 17:22:59):
array (
'cobSessionToken' => 'REDACTED',
'memSiteAccId' => 10381802,
'userSessionToken' => 'REDACTED'
)
Attempt 6 Received:
array (
'key' =>
array (
),
)
Attempt 7 Sent(2014-09-30 17:23:20):
array (
'cobSessionToken' => 'REDACTED',
'memSiteAccId' => 10381802,
'userSessionToken' => 'REDACTED'
)
Attempt 7 Received:
array (
'key' =>
array (
),
)
Attempt 8 Sent(2014-09-30 17:23:41):
array (
'cobSessionToken' => 'REDACTED',
'memSiteAccId' => 10381802,
'userSessionToken' => 'REDACTED'
)
Attempt 8 Received:
array (
'key' =>
array (
),
)
Attempt 9 Sent(2014-09-30 17:24:02):
array (
'cobSessionToken' => 'REDACTED',
'memSiteAccId' => 10381802,
'userSessionToken' => 'REDACTED'
)
Attempt 9 Received:
array (
'key' =>
array (
),
)
Attempt 10 Sent(2014-09-30 17:24:23):
array (
'cobSessionToken' => 'REDACTED',
'memSiteAccId' => 10381802,
'userSessionToken' => 'REDACTED'
)
Attempt 10 Received:
array (
'key' =>
array (
),
)
Attempt 11 Sent(2014-09-30 17:24:44):
array (
'cobSessionToken' => 'REDACTED',
'memSiteAccId' => 10381802,
'userSessionToken' => 'REDACTED'
)
Attempt 11 Received:
array (
'key' =>
array (
),
)
Attempt 12 Sent(2014-09-30 17:25:06):
array (
'cobSessionToken' => 'REDACTED',
'memSiteAccId' => 10381802,
'userSessionToken' => 'REDACTED'
)
Attempt 12 Received:
array (
'key' =>
array (
),
)
Attempt 13 Sent(2014-09-30 17:25:27):
array (
'cobSessionToken' => 'REDACTED',
'memSiteAccId' => 10381802,
'userSessionToken' => 'REDACTED'
)
Attempt 13 Received:
array (
'key' =>
array (
),
)
Attempt 14 Sent(2014-09-30 17:25:48):
array (
'cobSessionToken' => 'REDACTED',
'memSiteAccId' => 10381802,
'userSessionToken' => 'REDACTED'
)
Attempt 14 Received:
array (
'key' =>
array (
),
)
For other siteId's I can rely on receiving one of the following attributes:
['refreshInfo']['itemAccessStatus']['name'] == 'ACCESS_NOT_VERIFIED'
['refreshInfo']['userActionRequiredType']['name'] == 'CHANGE_CREDENTIALS'
Can a yodlee staffer please check their logs and investigate why siteId 16617 is not returning the expected data when using jsonsdk/DataService/getItemSummariesForSite
You will have to implement the complete add account flow indicated in this page of Add_Site_Account flow.
Please follow the flow diagram and code accordingly. Ideally you should call getSiteRefreshInfo to know the status of refresh of the account which you tried adding.

CakePHP many conditions to one field

This code:
$conditions = array(
'fields' => array(
'User.id'
),
'conditions' => array(
'AND' => array(
'UsersProblem.problem_id' => 38,
'UsersProblem.problem_id' => 34,
),
),
'recursive' => -1
);
$conditions['joins'][] = array(
'table' => 'users_problems',
'alias' => 'UsersProblem',
'type' => 'INNER',
'conditions' => array(
'User.id = UsersProblem.user_id',
));
Is transforming to this SQL query:
SELECT `User`.`id`
FROM `lawyers`.`users`
AS `User`
INNER JOIN `lawyers`.`users_problems`
AS `UsersProblem`
ON (`User`.`id` = `UsersProblem`.`user_id`)
WHERE `UsersProblem`.`problem_id` = 34
Where is AND UsersProblem.problem_id = 38"?
How to create correct find condition to get users with some list of problems? Which are linked as many to many relationship.
Using $this->Problem->find is not possible, beause I need to use 2 joins: users_problems and users_practices. And use for them AND condition, like this:
'AND' => array(
'UsersProblem.problem_id' => 38,
'UsersProblem.problem_id' => 34,
'UsersPractices.practice_id' => 1,
'UsersPractices.practice_id' => 2,
),
You're overwriting 'UsersProblem.problem_id'. Just think about it like the array it is. CakePHP is just using the PHP array structure to do these finds, and that means it follows array rules. But to get around that in cakephp, you're supposed to use a two dimensional array
Like this:
'AND' => array(
array('UsersProblem.problem_id' => 38),
array('UsersProblem.problem_id' => 34)
),
Instead of this:
'AND' => array(
'UsersProblem.problem_id' => 38,
'UsersProblem.problem_id' => 34
),
That way, instead of trying to set the key 'UsersProblem.problem_id' twice, you're making an array that looks like
0 -> array('UsersProblem.problem_id' => 38)
1 -> array('UsersProblem.problem_id' => 34)
And that will work, it's a workaround the CakePHP guys built into the system for this kind of situation.
I think you need to use OR instead of AND:
$conditions = array(
'fields' => array(
'User.id'
),
'conditions' => array(
'OR' => array(
array('UsersProblem.problem_id' => 38),
array('UsersProblem.problem_id' => 34),
),
),
'recursive' => -1
);
You can also roll this up as follows:
$conditions = array(
'fields' => array(
'User.id'
),
'conditions' => array(
'OR' => array(
'UsersProblem.problem_id' => array(34, 38)
),
'recursive' => -1
);
Change your conditions array as shown below:
$options = array(
'fields' => array('User.id'),
'conditions' => array('UsersProblem.problem_id' => array(38,34)),
'recursive' => -1
);
$options['joins'] = array(
array(
'table' => 'users_practices',
'alias' => 'UsersPractices',
'type' => 'INNER',
'conditions' => array(
/CONDITION OF JOIN/
),
array(
'table' => 'users_problems',
'alias' => 'UsersProblem',
'type' => 'INNER',
'conditions' => array(
'User.id = UsersProblem.user_id',
)
);
From User Model:
$this->find('list',$options);
Do not use AND/ OR because they are not optimized for above case.
For reference:
MYSQL OR vs IN performance
and
CakePHP right way to do this (get value from setting's table)
**Try the code for join tables in cakephp.......**
$options = array('joins' => array(
array(
'table' => 'modelname1',
'alias' => 'modelName1',
'type' => 'LEFT',
'foreignKey' => false,
'conditions' => array('modelname1.id = modelname2.mid')
)
),
'fields' => array('modelName1.field1', 'modelName1.field2', 'modelName2.field1', 'modelName2.field2'),
'conditions' => array('modelname.id' => 1, 'modelname2.field1' => ''),
'limit' => 10, 'page' => 1);
$this->modelName2->find($options);