i want to save wireless network to my profile i have use
cryptprotectdate() to convert it into BYTE*
now i need to convert it into hexadecimal to save it as profile password it i am not wrong so how to convert it into hexadecimal...
I have various php files which data is Posted to (like the password when the user signs in) How can I can I post to these php from vb.net (a desktop application that is Windows Forms, this is not about ASP.net)
thanks
I'm trying to put together a WordPress plugin and I want to grab a list of all categories (of other WordPress blogs) via XML-RPC. I have the following code and it looks like it works so far:
function get_categories($rpcurl,$username,$password){
$rpcurl2 = $rpcurl."/xmlrpc.php";
$params = array(0,$username,$password,true);
$request = xmlrpc_encode_request('metaWeblog.getCategories',$params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $rpcurl2);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$results = curl_exec($ch);
$res = xmlrpc_decode($results);
curl_close($ch);
return $res;
}
If I use $res I get the following string as the response: Array
If I use $results then I get:
categoryId17 parentId0 descriptionTest categoryDescription categoryNameTest
htmlUrlhttp://test.yoursite.com/?cat=17 rssUrlhttp://test.yoursite.com/?feed=rss2&cat=17
categoryId1 parentId0 descriptionUncategorized categoryDescription
categoryNameUncategorized htmlUrlhttp://test.yoursite.com/?cat=1
rssUrlhttp://test.yoursite.com/?feed=rss2&cat=1
I need to pull out the names after description so Uncategorized and Test in this case.
It's my first time coding in PHP. I got these results by echoing them to the page, so not sure if they get changed in that process or not...
By the way I modified the above code from one that posts to a WordPress blog remotely so maybe I haven't set some of the options correctly?
With var_dump($res) I get:
array(2) { [0]=> array(7) { ["categoryId"]=> string(2) "17" ["parentId"]=> string(1)
"0" ["description"]=> string(4) "Test" ["categoryDescription"]=> string(0) ""
["categoryName"]=> string(4) "Test" ["htmlUrl"]=> string(40)
"http://test.youreventwebsite.com/?cat=17" ["rssUrl"]=> string(54)
"http://test.youreventwebsite.com/?feed=rss2&cat=17" } [1]=> array(7) {
["categoryId"]=> string(1) "1" ["parentId"]=> string(1) "0" ["description"]=>
string(13) "Uncategorized" ["categoryDescription"]=> string(0) "" ["categoryName"]=>
string(13) "Uncategorized" ["htmlUrl"]=> string(39) "http://test.youreventwebsite.com/?cat=1"
["rssUrl"]=> string(53) "http://test.youreventwebsite.com/?feed=rss2&cat=1" } }
Background Story
I'm working at a software firm developing a test automation framework to replace our old spaghetti tangled system.
Since our system requires a login for almost everything we do, I decided it would be best to use @BeforeMethod, @DataProvider, and @Factory to setup my tests. However, I've run into some issues.
Sample Test Case
Lets say the software system is a baseball team roster. We want to test to make sure a user can search for a team member by name.
(Note: I'm aware that BeforeMethods don't run in any given order -- assume that's been taken care of for now.)
@BeforeMethod
public void setupSelenium() {
// login with username & password
// acknowledge announcements
// navigate to search page
}
@Test(dataProvider="players")
public void testSearch(String playerName, String searchTerm) {
// search for "searchTerm"
// browse through results
// pass if we find playerName
// fail (Didn't find the player)
}
This test case assumes the following:
The user has already logged on (in a BeforeMethod, most likely)
The user has already navigated to the search page (trivial, before method)
The parameters to the test are associated with the aforementioned login
The Problems
So lets try and figure out how to handle the parameters for the test case.
Idea #1
This method allows us to associate dataproviders with usernames, and lets us use multiple users for any specific test case!
@Test(dataProvider="players")
public void testSearch(String user, String pass, String name, String search) {
// login with user/pass
// acknowledge announcements
// navigate to search page
// ...
}
...but there's lots of repetition, as we have to make EVERY function accept two extra parameters. Not to mention, we're also testing the acknowledge announcements feature, which we don't actually want to test.
Idea #2
So lets use the factory to initialize things properly!
class BaseTestCase {
public BaseTestCase(String user, String password, Object[][] data);
}
class SomeTest {
@Factory
public void ...
}
With this, we end up having to write one factory per test case... Although, it does let us have multiple users per test-case.
Conclusion
I'm about fresh out of ideas. There was another idea I had where I was loading data from an XML file, and then calling the methods from a program... but its getting silly.
Any ideas?
Hi all,
I tried to use Devise 1.0.6 over Rails 2.3. I followed the installation instructions and the user can successfully sign up. However, when I use the registered user account to sign in, the password field is cleared up and nothing happened. Could anyone give me some ideas? Thanks in advance.
Currently my login controller doesn't work because i can't seem to fetch the username and password.
I'm currently using something like this:
form_username = str(request.params.get('username'))
db_user = meta.Session.query(User).filter_by(username=form_username)
if db_user is None:
return redirect('auth/error')
No matter which username is use, db_user always returns True and thus never goes to auth/error. I used the shell to play with this and i was able establish a connection with the database, so i'm not sure what i'm doing wrong here.
I need to make a SOAP webservice call to https://sandbox.mediamind.com/Eyeblaster.MediaMind.API/V2/AuthenticationService.svc?wsdl and to use the operation ClientLogin while passing through the parameters: ApplicationKey, Password, and UserName. The response is UserSecurityToken. They are all strings.
Here is the link fully explaining what I am trying to do:
https://sandbox.mediamind.com/Eyeblaster.MediaMind.API.Doc/?v=3
How can I do this on the command line? (Windows and/or Linux would be helpful)
Thanks!
I'm currently investigating migrating our infrastructure over to run on Amazon's EC2 and am trying to figure out the best way to set up a MySQL service. I'm leaning towards running our own MySQL instances, rather than going with Amazon's RDS, but am still considering the best approach for performance and cost on the instance itself.
In order to have persistent data, the MySQL data needs to be on an EBS volume (with some form of striped RAID, e.g. RAID0 or RAID10) to improve persistence. However, EBS IO is limited by the network interface (gigabit, so a theoretical maximum of 128 MB/s), while the ephemeral volumes have no such problem.
I did see a suggestion for running two MySQL servers on an instance, with a master running on the ephemeral disk (which we would also RAID) and a slave storing changes to an EBS volume, but this has some additional overhead and complexity (two servers).
What I was imagining is using some form of replicated file system such that I could have
a filesystem on top of a RAID0 of ephemeral volumes to maximise performance
all changes from the above immediately replicated to another RAID1 volume backed by multiple EBS volumes to ensure no data loss
The advantages of this would be
best possible IO performance for the DB server; no network delay in IO
decreased IO on EBS volumes (as all read IO will be done on the ephemeral volumes) so decreased cost
good data security, as it's backed onto redundant EBS volumes
However, I haven't seen an appropriate system to replicate all changes from one volume to the other; is there a filesystem, or any other approach, which will do this? The distributed file systems, e.g. GlusterFS, DRBD etc seem to focus on replicating disks between servers, can they be set up to do what I'm interested in here?
I also haven't seen anything about other's taking this approach. Do I have a solution in need of a problem here (i.e. is performance good enough, so this whole idea is redundant)? Is there some flaw in the plan?
Hi,
I've been Googling a lot, but I just can't figure out how to add a couple fields to user registration. By default Mediawiki only asks for username, password and real name. I noticed that form is a template under /includes/templates/UserLogin.php, but I don't want to modify that file to make the changes.
What is the correct way to do that?
I am working on a PHP framework and am currently designing error handling. Based on what I have read on SO, I should only use exceptions for, well, exceptional situations. Therefore throwing an exception when an incorrect password is entered is wrong.
Should I avoid using exceptions when I want to trigger a server error? If so, should I write my own error handling class?
I have an installer wizard thing called 'install creator'. I want to include my mySQL database into the installer or find another way that the user, upon installation, can just use my database. Prob is-not everyone has MySQL installed on the computer and even then, the user doesn't know the name of the database or my password. Somehow the database must be created automatically upon install, and for my purposes, some of the tables created. How can one do this. Thanks
Hey, I am looking for PHP login script that allows a user to sign in, confirm his email and save his login/password if he wants. Is there something free and simple to support and modify?
Thank you.
Michael
I'm trying to do something like this:
mysqldump --user c1bt3 --password=blah c1bt3 > c1bt{date}.sql
where date is replaced with the current date, i.e. c1bt5-11-10.sql, and I'm trying to do it from a linux shell script.
Any ideas how I can do this?
Hi,
i have this page:
login: [email protected]
password: m
I want to have the string "Editar mi perfil" aligned on the right, so i have added:
text-align: right
but it doesn't work,
I have tried also:
float:right
It works but goes a bit upper than I want.
Any idea?
Regards
Javi
how would i tranfoms this curl command:
curl -v -u 82xxxxxxxxxxxx63e6:api_token -X GET https://www.toggl.com/api/v6/time_entries.json
into urlib2?
I found this tutorial: http://www.voidspace.org.uk/python/articles/authentication.shtml
but they use a password and username. I can only use an API token.
Thank you.
see also this question:
Urllib2 raises 403 error while the same request in curl works fine
I have a login controller that use the hibernate uniqueResult method. Everything works fine when i test it in eclipse's tomcat server. But when i deploy my webapps to tomcat server (on the same machine) it fails: it always returns null even i use the correct credential.
Here is my hibernate code:
session.createCriteria(User.class)
.add(Restrictions.eq(User.USERNAME_FIELD, userName))
.add(Restrictions.eq(User.PASSWORD_FIELD, password)).uniqueResult();
Thank you!
I have a report developed with Crystal '08 and it is published on CMC.
My problem is when I changed the database to the production db, the report still asking for the development database password.
I've tried to publish the report with a diferent name, but it didn't work.
Thanks for your help!
Hi,
I am using Google API Ver 2 for .NET.
I want to access list of domains users with there information like userid and password.
Ho w can display list domain user's using Admin's credential?
Thanx
I am trying to open a remote shell via ssh to send commands from R.
As long as I send commands, I need to get results and send new commands that depends on the output of the previous ones.
For this reason I am looking for a solution to open a connection and manage it from within the R code until I have finished. I also need to open the connection with ssh key exchange (so without password authentication).
Looking at CRAN I didn't find anything useful.
Hi,
I'm trying to secure my WS client to be able to call the WS.
My code looks like this:
SendSmsService smsService = new SendSmsService();
SendSms sendSMS = smsService.getSendSms();
BindingProvider stub = (BindingProvider)sendSMS;
//Override endpoint with local copy of wsdl.
String URL ="";//here is the wsdl url
Map<String,Object> requestContext = stub.getRequestContext();
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, URL);
//Set usernametoken
URL fileURL = loader.getResource("client-config.xml");
File file = new File(fileURL.getFile());
FileInputStream clientConfig = null;
try {
clientConfig = new FileInputStream(file);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
XWSSecurityConfiguration config = null;
try {
config = SecurityConfigurationFactory.newXWSSecurityConfiguration(clientConfig);
} catch (Exception e) {
e.printStackTrace();
log.warn("Exception: "+e.getMessage());
}
requestContext.put(XWSSecurityConfiguration.MESSAGE_SECURITY_CONFIGURATION, config);
//Invoke the web service
String requestId = null;
try {
requestId = sendSMS.sendSms(addresses, senderName, charging, message, receiptRequest);
} catch (PolicyException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
and the config file looks like this:
<xwss:JAXRPCSecurity xmlns:xwss="http://java.sun.com/xml/ns/xwss/config" optimize="true">
<xwss:Service>
<xwss:SecurityConfiguration dumpMessages="true"
xmlns:xwss="http://java.sun.com/xml/ns/xwss/config">
<xwss:UsernameToken name="username" password="password>
</xwss:SecurityConfiguration>
</xwss:Service>
<xwss:SecurityEnvironmentHandler>
util.SecurityEnvironmentHandler
</xwss:SecurityEnvironmentHandler>
</xwss:JAXRPCSecurity>
The SecurityEnviromentHandler is a dummy class that implements javax.security.auth.callback.CallbackHandler.
Authentication must be in compliance with Oasis Web Services Security Username Token Profile 1.0.
But I'm constantly getting "Security header not valid" error.
Where am I going wrong, can anyone tell me.
I used wsimport(JAX_WS 2.1 to generate classes for my client)
Note:Only thing I know about this WS is WSDL URL and user&pass for authentication
I have a progressbar that that is show progress returned by the backgroundworker do_dowork event like below .
if (ftpSourceFilePath.Scheme == Uri.UriSchemeFtp)
{
FtpWebRequest objRequest = (FtpWebRequest)FtpWebRequest.Create(ftpSourceFilePath);
NetworkCredential objCredential = new NetworkCredential(userName, password);
objRequest.Credentials = objCredential;
objRequest.Method = WebRequestMethods.Ftp.DownloadFile;
FtpWebResponse objResponse = (FtpWebResponse)objRequest.GetResponse();
StreamReader objReader = new StreamReader(objResponse.GetResponseStream());
int len = 0;
int iProgressPercentage = 0;
FileStream objFS = new FileStream((cd+"\\VolareUpdate.rar"), FileMode.Create, FileAccess.Write, FileShare.Read);
while ((len = objReader.BaseStream.Read(buffer, 0, buffer.Length)) > 0)
{
objFS.Write(buffer, 0, len);
iRunningByteTotal += len;
double dIndex = (double)(iRunningByteTotal);
double dTotal = (double)buffer.Length;
double dProgressPercentage = (dIndex / dTotal);
iProgressPercentage = (int)(dProgressPercentage);
if (iProgressPercentage > 100)
{
iProgressPercentage = 100;
}
bw.ReportProgress(iProgressPercentage);
}
}
However, my progressbar does not update. While searching , i was told the UI thread is being blocked and then i thought may be passing the progress outside the loop will do the trick. then i change to this
if (ftpSourceFilePath.Scheme == Uri.UriSchemeFtp)
{
FtpWebRequest objRequest = (FtpWebRequest)FtpWebRequest.Create(ftpSourceFilePath);
NetworkCredential objCredential = new NetworkCredential(userName, password);
objRequest.Credentials = objCredential;
objRequest.Method = WebRequestMethods.Ftp.DownloadFile;
FtpWebResponse objResponse = (FtpWebResponse)objRequest.GetResponse();
StreamReader objReader = new StreamReader(objResponse.GetResponseStream());
int len = 0;
int iProgressPercentage = 0;
FileStream objFS = new FileStream((cd+"\\VolareUpdate.rar"), FileMode.Create, FileAccess.Write, FileShare.Read);
while ((len = objReader.BaseStream.Read(buffer, 0, buffer.Length)) > 0)
{
objFS.Write(buffer, 0, len);
iRunningByteTotal += len;
double dIndex = (double)(iRunningByteTotal);
double dTotal = (double)buffer.Length;
double dProgressPercentage = (dIndex / dTotal);
iProgressPercentage = (int)(dProgressPercentage);
if (iProgressPercentage > 100)
{
iProgressPercentage = 100;
}
// System.Threading.Thread.Sleep(2000);
iProgressPercentage++;
// SetText("F", true);
}
bw.ReportProgress(iProgressPercentage);
progressBar.Refresh();
}
However still didn't help. When i put break point in my workerprogresschanged event, it show the progressbar.value however does not update. I tried progressbar.update(0, i also tried sleeping the thread for a while in the loop still didn't help. Please any suggestion/help would be appreciated .
I am new to TFS 2010 and wanted to give it a fair try for a small project with a team of 2-3 remote people.
Is it a requirement that all my team users are part of an Active Directory network setup? or can I have my team-members to be loosely coupled and be able to login using username/password?