I am creating a secure web based API that uses HTTPS however if I allow the users to configure it (include sending password) using a query string will this also be secure or should I force it to be done via a POST?
Hi, i would like to create a Rails controller that download a serie of jpg files from the web and directly write them into database as binary
(I am not trying to do an upload form)
Any clue on the way to do that ?
Thank you
Edit :
Here is some code I already wrote using attachment-fu gem :
http = Net::HTTP.new('awebsite', 443)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.start() { |http|
req = Net::HTTP::Get.new("image.jpg")
req.basic_auth login, password
response = http.request(req)
attachment = Attachment.new(:uploaded_data => response.body)
attachement.save
}
And I get an "undefined method `content_type' for #" error
I am trying to write a snippet of PHP to connect to a third party's API via SOAP to enter some data into their database. The API requires me to pass several mandatory fields for every call (username, password, companyid, entitytype) in addition to the mandatory data fields. It also requires me to call the "ValidateEntity" funciton before calling the "CreateEntity" function. Documentation can be found here:
http://wiki.agemni.com/Getting_Started/APIs/Database_API
I have never worked with SOAP before, so I am very new to this. Here is what I have so far:
error_reporting(E_ALL);
ini_set('display_errors', '1');
$client = new SoapClient("http://agemni.com/AgemniWebservices/service1.asmx?WSDL", array('trace'=> true));
$options = array(
'username' => "myuser",
'password' => "mypassword",
'companyid' => myID,
'entitytype' => 2
);
$params = array(
'fname' => "John",
'lname' => "Doe",
'phone' => "859-333-3333",
'zip' => "40332",
'area id' => "12345",
'lead id' => "28222",
'contactdate' => "4/10/2010"
);
$validate = $client->__soapCall("ValidateEntity", array($params), array($options));
$client->__soapCall("CreateEntity", array($params), array($options));
echo "<pre>";
var_dump($client-> __getLastRequestHeaders());
var_dump($client-> __getLastRequest());
var_dump($client-> __getLastResponseHeaders());
var_dump($client-> __getLastResponse());
var_dump($result);
echo "</pre>";
Upon executing this code, I get the following error:
Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object hasn't 'objecttype' property in /www/tmp/index-soap.php:24 Stack trace: #0 /www/tmp/index-soap.php(24): SoapClient->__soapCall('ValidateEntity', Array) #1 {main} thrown in /www/stealth/tmp/index-soap.php on line 24
I guess my question is.. am I even going about doing this the right way? I know this is a very broad question, but I appreciate any advice you can give me about making this work. Please let me know if you require more detail.
Thanks!
For what x is
The expression x IS NOT NULL is not equal to NOT(x IS NULL), as is the case in 2VL
(quote from this answer, which is quoting Fabian Pascal Practical Issues in Database Management - A Reference for the Thinking Practitioner -- near the end of that answer)
My guess is when x IS NULL is NULL, but I cannot guess when that would be (i.e. I haven't checked the SQL standard).
I'm working on an upgrade project and build management is done in Maven 1.0.2. Java version will change to J2SE 5.
Please include in your answer if you have first hand experience on that particular combination (Maven 1.0.2 and J2SE 5)
Thanks
hdk
Hi,
I need to create a login and account validation using struts 2 and ldap, so the flow would be:
Display login page
User inputs his username and password
Validates user's existence in ldap
Redirect to welcome page with message and user's name
How should I get it done in Struts 2 and Ldap?
Thank you.
Hi,
i have this page.
login: [email protected]
password: m
I've gave a width to "td.select_edad label" but it doesnt work..
I know it's deprecated, so what is your advice?
Another question: why "height" (also deprecated) is working ok for the fields of the filter?
Regards
Javi
Yes, yes, i know user and password.
I need some trick in php to get logged into a website and retrieve some images/contents, like a normal website.
Obviously with a curl o file_get_contents it doesn't work because i'm not authenticated.
How i can do?
I need to be able to write a script to automatically connect mysql in batch mode so that I can run some .sql files.
I tried to enter the following at the prompt:
./mysql -u root -p mypassword
but I keep getting a "Enter password: " prompt.
What am I doing incorrectly?
Thanks.
I am reading the Head First PHP/Mysql book and they say to store both the user's username, email into cookies and sessions. Is it safe to assume that everyone nowadays accepts cookies? Or should I store both in sessions and cookies?
I am not storing any sensitive data in cookies such as password, etc.
Hi,
I am using Acl9 to manage the roles and I want to hide the checkbox usertype if the user has the role :customer and show it if the role is :manager. I want that just the :manager can edit all the fields and some for the :customer.
Thank you for your help!
<h1>Editing user</h1>
<% form_for(@user) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :usertype %><br />
<%= f.check_box :usertype %>
</p>
<p>
<%= f.label :surname %><br />
<%= f.text_field :surname %>
</p>
<p>
<%= f.label :firstname %><br />
<%= f.text_field :firstname %>
</p>
<p>
<%= f.label :phone %><br />
<%= f.text_field :phone %>
</p>
<p>
<%= f.label :email %><br />
<%= f.text_field :email %>
</p>
<p>
<%= f.label :registrationdate %><br />
<%= f.datetime_select :registrationdate %>
</p>
<p>
<%= f.label :login %><br />
<%= f.text_field :login %>
</p>
<p>
<%= f.label :password %><br />
<%= f.text_field :password %>
</p>
<p>
<%= f.submit 'Update' %>
</p>
<% end %>
<%= link_to 'Show', @user %> |
<%= link_to 'Back', users_path %>
I have the following class
class Identity < OmniAuth:: Identity:: Models:: ActiveRecord
attr_accessible :email, :name, :password_digest, :password, :password_confirmation
end
I wonder if the above properties are the only ones allowed for a class that derive from a OmniAuth. I wish I could add some more like FirstName, LastName, age, gender, and so on. Do I need to create an other model for those properties or can I just add them to the Identity model?
Thanks for helping.
Hi,
how can i convert an index to an string ?
For example i would like to get the 'signin' index here:
array(1) {
["signin"]=>
array(2) {
["email_address"]=>
string(0) ""
["password"]=>
string(0) ""
}
}
Javi
Hi,
I find smart pointers to be a lot more comfortable than raw pointers. So is it a good idea to always use smart pointers? ( Please note that I am from Java background and hence don't much like the idea of explicit memory management. So unless there are some serious performance issues with smart pointers, I'd like to stick with them. )
Any advice would be greatly appreciated. Thanks.
how can i control the number of retries of the "opener.open"?
for example, in the following code, it will send about 6 "GET" HTTP requests (i saw it in the Wireshark sniffer) before it goes to the " except urllib.error.URLError" success/no-success lines.
password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()
password_mgr.add_password(None,url, username, password)
handler = urllib.request.HTTPBasicAuthHandler(password_mgr)
opener = urllib.request.build_opener(handler)
try:
resp = opener.open(url,None,1)
except urllib.error.URLError as e:
print ("no success")
else:
print ("success!")
This is regarding Spring OpenSessionInViewFilter using with @Transactional annotation at service layer.
i went through so many stack overflow post on this but still confused about whether i should use OpenSessionInViewFilter or not to avoid LazyInitializationException
It would be great help if somebody help me find out answer to below queries.
Is it bad practice to use OpenSessionInViewFilter in application
having complex schema.
using this filter can cause N+1 problem
if we are using OpenSessionInViewFilter does it mean @Transactional not required?
Below is my Spring config file
<context:component-scan base-package="com.test"/>
<context:annotation-config/>
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="resources/messages" />
<property name="defaultEncoding" value="UTF-8" />
</bean>
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
p:location="/WEB-INF/jdbc.properties" />
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
p:driverClassName="${jdbc.driverClassName}"
p:url="${jdbc.databaseurl}" p:username="${jdbc.username}"
p:password="${jdbc.password}" />
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation">
<value>classpath:hibernate.cfg.xml</value>
</property>
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${jdbc.dialect}</prop>
<prop key="hibernate.show_sql">true</prop>
<!--
<prop key="hibernate.hbm2ddl.auto">create</prop>
-->
</props>
</property>
</bean>
<tx:annotation-driven />
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
I backed up a SQL Server 2005 database and restored it to a new SQL 2008 instance. The restore was quick and successful. Everything was fine for an hour or so.
Suddenly, the database is now stuck in "(Restoring...)" state in Management Studio and has a green arrow icon, and my application login is failing!
Any advice? :-)
I am working on a webapplication
How can i create SQL for the following
Database Information
User information
Username - String
Password - String
Admin or Client - boolean
Last login – Date/Time
LogItem
typeLogItem – String (Page name?)
hitCount – int
View
PageURL
UserID
Transaction
User – String
DateTimeStamp
SKU – int
Purchase-boolean
TransactionID-int
Inventory information
Sku number - int
Item description - String
Price to customer - double
Count - in
I'm currently developing a small Database Management System for a local company. How would you go about explaining how the system you have designed to a client? If they are non-technical and have no understanding of programming, how would you go about showing what the system will do and how it will do it? I guess some sort of visual representation of the system but this seems very patronising to me.
Hello everyone,
I am using Windows Server 2008 R2 with Windows Media Service. At the client side, I want to use Silverlight to play the media file. I am using VSTS 2008 + Silverlight 3 + ASP.Net + .Net 3.5. I want to know how to implement a custom authentication protocol (I have a custom user database, which contains user name and password. I want to enable logged-in user to be able to play through Silverlight)?
thanks in advance,
George
i have the following function
function change()
{
var input=document.getElementById('pas');
var input2= input.cloneNode(false);
input2.type='password';
input.parentNode.replaceChild(input2,input);
input2.focus();
}
but focus() doesn't work in ie7, so what can i do!
i want to have the cursor inside of input!
thanks
I'm planning some kind of APNS service which sends a password data.
But I don't want to make user's device alert any message when the app is not running.
Is this possible? And how to do this?
This is more of a management issue... Anyway
We're currently making quiz-like game which, well includes a LOT of sound files, and it's bogging down xcode. It's so slow that scrolling up and down takes minutes.
I looking for free ASP.NET based content management system (CMS) which has the following features:
Blogs (Admin, some super users can have their own blogs)
Forums (Admins can create forums. Some moderation features)
Admin Dashboard
Integration with LinkedIn, Orkut and Facebook (native or through freely available add-ons)
Support for moderated user registration (moderated by Admin)
Windows Sharepoint services 3.0 is an option. With some tweaking, it supports all the above and there are free third party web parts available.
NB: The CMS listed must be free, as in beer.