ExtJS Custom Vtypes - extjs

Iam using Vtypes for Changpassword window.
My requirment is need to use only vtypes for all required/validations fields
So with out enter data clik on save its shows bubbles for required fields,but also show vtype for oldpassword not match.So how can use vtype after hitting database(From server) So is it possible?How
please provide some idea
Thanks in advance

You cannot use Ext.form.VTypes on the server unless you use some sort of JavaScript server (node.js with an ExtJS adapter - if there is one). You didn't mention the programming language you use on the server, so the answer is quite generic. To return errors from form posts that will be displayed as form field errors, your response to the form submit must conform to the following format:
{
success: false,
errors: {
oldpassword: "Your current password does not match"
}
}
The important part is the errors-structure. It contains key-value-pairs with the key being the name of the form field you'd like to display the error on and the value being the error message that will be displayed.

Related

query data in a airtable database using url

I want to implement URL for search specific data in my base using filterByFormula
below are my link and I got an error and how to resolve that
my url:
api.airtable.com/v0/APPID/Stories?filterByFormula=(FIND(“Car (in robot form) will offer a hug when I am stressed out”,{User want}) &api_key=MYKEY
Error :
{
"error": {
"type": "INVALID_FILTER_BY_FORMULA",
"message": "The formula for filtering records is invalid: Invalid formula. Please check your formula text."
}
}
I tried using postman, please help me.
While querying filtered data from Airtable via API, you don't have to use FIND keyword. You can filter data with simple Airtable formula like structure. For example,
{Email} = 'johnwick#neverdie.com'
Above filter retrieve all the records from the table whose Email is simply johnwick#neverdie.com
To limit number of records retrieve by API maxRecord parameter is available for that. For more info about various parameters please refer my answer here AirTable API Find record by email or official Airtable API Documentation
In your case
API url would be structured like,
api.airtable.com/v0/APPID/Stories?filterByFormula=Car+(in+robot+form)+will+offer+a+hug+when+I+am+stressed+out%3D%22User+want%22&api_key=MYKEY
For more info about Airtable API encoding, check this https://codepen.io/airtable/full/rLKkYB?baseId=app1C5TVoophmmr8M&tableId=tblvILr4aSAYI98oa
Hope this helps!

Meteor - How safe it is?

I'm actually creating my first app using meteor, in particular using angular 2. I've experience with Angular 1 and 2, so based on it. I've some points of concern...
Let's imagine this scenario...My data stored on MongoDb:
Collection: clients
{
name : "Happy client",
password : "Something non encrypted",
fullCrediCardNumber : "0000 0000 0000 0000"
}
Now, on my meteor client folder, I've this struncture...
collection clients.ts (server folder)
export var Clients = new Mongo.Collection('clients');
component client.ts (not server folder)
import {Clients} from '../collections/clients.ts';
class MyClients {
clients: Array<Object>;
constructor(zone: NgZone) {
this.clients = Clients.find();
}
}
..and for last: the html page to render it, but just display the name of the clients:
<li *ngFor="#item of clients">
{{client.name}}
</li>
Ok so far. but my concern is: In angular 1 & 2 applications the component or controller or directive runs on the client side, not server side.
I set my html just to show the name of the client. but since it's ah html rendering, probably with some skill is pretty easy to inject some code into the HTML render on angular to display all my fields.
Or could be easy to go to the console and type some commands to display the entire object from the database collection.
So, my question is: How safe meteor is in this sense ? Does my concerns correct ? Is meteor capable to protect my data , protect the name of the collections ? I know that I can specify on the find() to not bring me those sensitive data, but since the find() could be running not on the server side, it could be easy to modify it on the fly, no ?
Anyway...I will appreciate explanations about how meteor is safe (or not) in this sense.
ty !
You can protect data by simply not publishing any sensitive data on the server side.
Meteor.publish("my-clients", function () {
return Clients.find({
contractorId: this.userId // Publish only the current user's clients
}, {
name: 1, // Publish only the fields you want the browser to know of
phoneNumber: 1
});
});
This example only publishes the name and address fields of the currently logged in user's clients, but not their password or fullCreditCardNumber.
Another good example is the Meteor.users collection. On the server it contains all user data, login credentials, profiles etc. for all users. But it's also accessible on the client side. Meteor does two important things to protect this very sensitive collection:
By default it only publishes one document: the user that's logged in. If you type Meteor.users.find().fetch() into the browser console, you'll only see the currently logged in user's data, and there's no way on the client side to get the entire MongoDB users collection. The correct way to do this is to restrict the amount of published documents in your Meteor.publish function. See my example above, or 10.9 in the Meteor publish and subscribe tutorial.
Not the entire user document gets published. For example OAuth login credentials and password hashes aren't, you won't find them in the client-side collection. You can always choose which part of a document gets published, a simple way to do that is using MongoDB projections, like in the example above.

Using satellizer to login via facebook and sending user information to server

I am attempting to send back to the sever the user information from satellizer.
I believe the call is as per this url:
https://github.com/sahat/satellizer#authauthenticatename-userdata
$auth.authenticate(name, [userData])
However when I use it :
$auth.authenticate('facebook', ['userData'])
my sever receives :
{ '0': 'userData',
code: 'AQB8ofHRuC',
clientId: '1625070294abcdef',
redirectUri: 'http://localhost:3000/' }
instead of actually receiving the userData.. what am i missing here ?
[userdata] is a kind of custom data, this means that you can put in it your data (some values). When you put $auth.authenticate('facebook', ['userData']) you put an array with one string element 'userData'. I think that it make sens to grab info on server by uid.
UPDATE
I found recent a link
https://github.com/sahat/satellizer/blob/master/examples/server/node/server.js#L537. You can translate node js code in your server programming language code.

wpf "emailto" - with attachments

I am developing a WPF app in MVVM presentation pattern. I have a grid and I am trying to have an "emailto" hyperlink and when the user clicks that i am trying to export all the data to an excel and open the default email client with a draft new message window(email client could be Lotus/Outlook) and attach the excel as an attachment to the mail. I am able to define a "Mailto" hyperlink and when i click that i am able to open the draft message email window. But i am not sure how to send the excel as an attachment. Any help is greatly appreciated.
By sending an Excel file you don't mean generating of this file somehow. Right? So you just need to attach a file.
I always use Andrew Baker's MAPI wrapper class which seems to be very reliable and has never failed for last 6 years. It's just 18Kb of C# code and it does exactly what you need.
var message = new MapiMailMessage(subject, body);
message.Recipients.Add(mailAddress);
message.Files.Add(filePath);
message.ShowDialog();
You could use Simple MAPI API to solve your problem:
var mapi = new Mapi();
mapi.Logon(IntPtr.Zero);
foreach (var filePath in files)
mapi.Attach(filePath);
mapi.Send("subject", "body text", true /* show send message dialog to user */);
mapi.Logoff();

atk4 SQLAuth in Frontend.php

in Frontend.php I replaced this:
$this->add('BasicAuth')
->allow('demo','demo')
// use check() and allowPage for white-list based auth checking
//->check()
;
With this:
$this->add('SQLAuth')->setSource('user','email','password')
// use check() and allowPage for white-list based auth checking
//->check()
;
based on this you tube video: http://www.youtube.com/watch?v=0_OROS53Fq8&feature=relmfu
However, the SQLAuth will not work. I get this error:
Fatal error: Call to a member function loaded() on a non-object in
C:\wamp\www\atk4\lib\Auth\Basic.php on line 242
My table name is correct, and i know the connection is working and there are users in the table, because I built a user registration form and CRUD that works as I walked through the you tube video.
Anybody have an idea what I am doing wrong here?
SQLAuth is going to be removed in 4.2 and should not be used anymore. You can use BasicAuth and set it to respond to a model based on your user table

Resources