appliance: change the way we find git branch in build.sh

(cherry picked from commit 493c0a68d2332cb9275902128c28f926a909f4ed)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	tools/appliance/build.sh
git: don't let db-police hook fail for no changes in setup/db

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
CLOUDSTACK-7264:NPE while creating scheduled/recurring snapshots for the
removed account with cleanup_needed=1.
appliance: use the right way to get git branch name

Taken from Junio C Hamano's blog [1], git's maintainer, he must not be wrong :)

[1] http://git-blame.blogspot.ch/2013/06/checking-current-branch-programatically.html

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit e16414e56d8f398f8ddbbde89d3ee833582b8bb2)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
CLOUDSTACK-6695: Added support to the UI for uploading a chain of certificates

In the "SSL Certificate" dialog we added:
- new field for the root certificate;
- a button to add intermediate certificates if necessary; when this is pressed, a new field, called "Intermediate certificate 1" is added; pressed again, "Intermediate certificate 2" field is added, and so on.

We upload the certificates in order: first the root certificate (with id=1), then the intermediate certificates (with id=2,3,..) and finally the server certificate.
When uploading a certificate, we wait for the upload to be completed successfully and only then we proceed to uploading the next one. If one fails, we report failure and don't continue with the remaining.

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
appliance: fix branch finding method from e16414e even Junio can be wrong

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit bbaefb8e5def610a654fba907c8ec3f868416bdf)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
appliance: box commands for dumb bash in cleaning branch name, in build.sh

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit edb5650c737d582595e134aab286e7304f299983)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
UI > Infrastructure > Add Primary Storage > use custom function if it's available.
CLOUDSTACK-6486: Guest network guru - when add network, validate isolation method in case insensitive manner
Fixed few coverity issues
Fixed few coverity reported issues around concurrency, null checks
Fixed few coverity issues reported
    Fixed CLOUDSTACK-7303 [LDAP] while importing ldap users, update the user info if it already exists in cloudstack
CLOUDSTACK-7283: listUsers - for regular user, only return the caller info. If there are more users under the same account, their information should never be returned
CLOUDSTACK-7295: VMs is Stopped state have no host ID, resulting in NPE
CLOUDSTACK-7312:ISOs cannot be downloaded from URLs without matching
file extensions.
CLOUDSTACK: Test script to verify fix for CS-5332

Signed-off-by: sanjeev <sanjeev@apache.org>
Signed-off-by: Santhosh Edukulla <santhosh.edukulla@gmail.com>
CLOUDSTACK-7083: Add SAML2 SSO plugin skeleton and stub

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
client: add saml2 plugin dependency on client artifact

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
saml2: add spring security saml2 extension 1.0.0.RELEASE

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>