Would it be possible to restrict the commit in SVN until the Change Request WI is Approved - polarion

I am using Polarion ALM 20 and I am trying to achieve this use case:
I would like to have restriction on SVN, that do not allow for commit unless a CR in Polarion is approved
Please advice how I can do this.
Thanks,
Sadanand

In the Polarion SDK you find an example which is doing quite a similar thing you need:
"[..] check, if the comment of commit message contains a link of work
item, which have to be resolvable and not to be resolved. The idea is
to ensure, that each revision will be linked to not resolved work
item."
polarion.example.commithook

Related

2SXC/DNN - Delete ADAM Files in Entity

We're designing a system for a client where they are allowing authenticated users to upload images. We've created an API to upload the files but the client only wants the latest file and delete all previous ones so that there would only ever be one.
We've looked through the docs and can't come across a way for ADAM to handle this in both 2SXC and DNN's file system.
Internally when deleting images we see API calls like the following to the internal 2SXC API, but we're wondering if this is exposed somewhere within the public API?
https://somedomain.com/api/2sxc/app/auto/data/61393528-b401-411f-a001-f423ea46700a/b7d04e2c-c565-496c-8efb-aa133cf90d33/Photo/delete?subfolder=&isFolder=false&id=189&usePortalRoot=false&appId=3
We could probably use the same endpoint above, but we'd likely run into permission issues or changes to the APIs that could be problematic.
Thank you for any advice you can give! Perhaps #iJungleBoy can provide some thoughts on this.
As a solution from a completely different direction, if you are on the later release of 2sxc (v12.8+, v13+), and comfortable programming in C#, you might consider doing this as a "cleanup" from a Dnn Scheduled Task. This can be done with a relatively easy setup. We have a Gist in place that we use as a starter. You simply put the code in the /App_Code folder then setup a normal Dnn Scheduled Task. NOTE that you can scroll down to the first comment on the Gist to see a screenshot of a complete working setup.
Accuraty's AccuTasks template on GitHub Gists
There are two more key things to note:
You need to install Dnn's CodeDom 3.6 because the example uses the later versions C#'s string interpolation - OR remove the few $"ASL2021 - {this.GetType().Name}, Task Scheduled Email", bits or convert to string.Format() or something.
Since your task's code is NOT running in a (2sxc) module, if needed, you'll do stuff like this: 2sxc Docs - Use 2sxc Instance or App Data from External C# Code
So, if you are comfortable writing code that "finds and deletes stuff older than NN days" - this might be the way to go.

New to DNN.... inherited hacked site

I was just hired to maintain and redesign various site the company has running on an old version of DNN. The site has been hacked and someone uploaded some directories and web.config files that were redirecting users to stream suspicious streaming sites. Also, the attacker added some scripts that show Google Ads on all the blog articles. Needless to say its a mess.
Nevertheless, I was able to go in there, deleted a super admin account (that's how they got in I think) , delete a few directories that had over a thousand html files for streaming sites and also deleted the old FCK Editor.
I am completely new to DNN and need some help with the directory and structure to try and see if I can resolve this. So far, I cannot get rid of the Google Ads in the blog and for the life of me I cannot find where the blog articles live inside the root/directory. When I go in there and delete the ads through the DNN UI the ads come back in hours or a couple of days. The directories with the html files have not returned. Just the ads.
I know that we have to upgrade but if I remove the ads I will have more to to develop the new sites without feeling rushed because of the current issue.
If anyone can point me in the right direction I would really appreciate it.
That sounds awful, as obviously someone (ore something) still manipulates your site from the outside (or inside?). There are a lot of issues on old DNN Versions, and the only thing I can really recommend is to find an upgrade path to the newest version. I don't know how big your site is, maybe it is easier to set it up from scratch with a new version (if the site is not too big).
The directory structure does not help you finding any content as everything is stored in a database. To be more specific I would need more information about the DNN version and the extensions (and versions of the extensions) in use, but disclosing this here in the public could be a security risk for you. You could write me a PM here if you wish to get in contact.
To find people (maybe in your area) who can help you could give these web sites a try: https://dnncommunity.org (Resources > Forums) and https://dodnn.work/.
It sounds like your site might have been impacted by a few different exploits, and most likely I would guess it is version 7.x or earlier and been upgraded from versions prior to that.
For the immediate need you are going to need to try and identify anything and everything that is out of the norm, this can be very daunting for those that are not familiar with the platform, but a few tips.
Look in the DB for data in the Header or Footer field of the TabModules table
Look for any rogue files that really should not be there, anything with an extension of (.php, .asp, etc.)
Look for rogue files in directories outside of the /Portals/* folder that don't match a DNN Install. (This takes a bit of personal experience.)
Look at your default.aspx file it should NOT have a recent modified date. If it does, compare it against the one that you get when you download the install package of that version of DNN
Now, once you have done this, be sure to do any mitigations that you can for known exploits. Including:
Delete /Install/Install.aspx
Delete /Install/InstallWizard.aspx
Disable any host account with a username of 'host' and create a new one if that was your only one
Feel free to email me directly as well if you need some help.

Exportint Trac wiki to Confluence using UWC tool

I want to create an Export of Trac Wiki and import it to COnfluence using UWC tool.
All Trac Wiki Pages and Attachments are stored in Postgres Database.
Can anyone please let me know how can i create Trac Export which can be readable by UWC. I am confused about TracEnviorment where can i find this?
Thank You,
Akash
Last thing first: If you don't know about a Trac Environment, you'll hardly be fit for the task you're aiming at right now. Start reading a bit about Trac, that is largely self-documenting, could help. No matter from where, be it the 'TracEnvironment' page in your own Trac wiki or the authoritative resource.
OTOH I'm not familiar at all with UWC, but a bit of research revealed, that Trac wiki is supported by a user-contributed module in UWC. So I guess that its documentation page is the natural place to start from. From what I've read so far the export/import is file-based and in line with recommendations under Exporter on that same page.
First, read https://migrations.atlassian.net/wiki/display/UWC/UWC+Trac+Notes.
Second, for attachments, you may need to use this as a reference http://l33t.peopleperhour.com/blog/2014/07/10/converting-a-trac-wiki-to-confluence/, anyway you will need to adapt it to your actual DBMS behind Trac.
Note that the current UWC - Trac integration is not as polished as someone may expect, so prepare yourself to download UWC source, debug it and patch it.

Receiving / retrieving email in CakePHP

I am developing a basic yet highly customized CRM for a small training centre which has the ability to store student records and also send emails to them. I'm using SwiftMailer following this excellent tutorial in CakePHP to accomplish the sending part.
Of course, students are sometimes going to reply to emails and I'd like to retrieve them within my CRM and store them along with the student record.
However, I cannot find a single reference to doing this. I've tried the following Google searches: "receiving email cakephp" , "retrieving email cakephp" and even "email client cakephp" but all of these queries give results relating to sending mail rather than receiving it -- very frustrating!
Finally, I broadened my search to non-cake solutions and found someone recommending a library called ezComponents. It doesn't seem to have had any active development for about a year, but it includes an email receiving class which is exactly what I want. Unfortunately, I have no idea how to add this to CakePHP and the only post I've been able to find on the entire web on the matter doesn't exactly go into much detail. It's certainly not a step-by-step tutorial on using ezComponents on CakePHP like the SwiftMailer tutorial I mentioned above.
I also found a class on Google Code called php-imap which looks like it would do the job but, again, I haven't the slightest clue how to get it working happily in Cake like SwiftMailer is.
I realize that I may have to learn how to package classes for use in Cake by myself but I'm asking this question first on the off-chance that there is already a Cake-friendly solution to this problem that I just haven't realized :-)
Joseph
Thanks to everyone for your answers, but I've been doing some more searching and it looks like the solution is actually incredibly simple.
Basically, with the help of a plugin, I can set up the mail server in databases.php as a datasource and then write a Model and Controller to interact with it.
Here's the example I found: https://github.com/kvz/cakephp-emails-plugin
Edit: the repo has been deprecated and is now available at https://github.com/kvz/deprecated/tree/cakephp-emails-plugin
You will want to pipe your email to PHP and use stdin:// to read the contents of the email and add the e-mail to your database.
I've done this with cake and the simplest way is to make a Cake console application to handle the parsing. Also using cpanel's account level filtering to generate the pipe is really simple.
http://forums.cpanel.net/f5/piping-mail-php-scripts-howto-checklist-50985.html
http://www.evolt.org/incoming_mail_and_php
Sounds like you want to include SwiftMailer as a Cake plugin, amirite?
http://book.cakephp.org/view/1111/Plugins
-- if you want to package it yourself. Otherwise, a cursory search of the Bakery yielded this result:
http://bakery.cakephp.org/articles/sky_l3ppard/2009/11/07/updated-swiftmailer-4-xx-component-with-attachments-and-plugins
Hopefully it will at least get you pointed in the right direction. HTH. :)

When using Trac and SVN together, how will I know that a file is committed to solve a certain ticket?

For example, a file is modified to do an enhance ticket, what I want to do is associated the committed file to the ticket. When using Trac and SVN together, how will I know that a file is committed to solve a certain ticket? Is this possible?
Thank you.
As stated on the TracWiki, the intended workflow is:
A Trac user begins work on a ticket
They obtain code from the version control system
After the work is completed they perform a commit of their
modifications to the version control
repository
The user inserts the Trac ticket number into the commit message as a
TracLink
Trac can now display the change set for the ticket
Where the TracLink is something like #1 or ticket:1 or even comment:1:ticket:2 when referring to a ticket.
If you miss creating the link when the commit is made, you can still create one in the ticket comments themselves using TracLinks such as: r2, r1:3, [1:3], log:#1:3, etc.
you can link to the revision when closing ticket: r253, e.g.
and you can link to the ticket in commit message: #7525, e.g.
other than that, I doubt that anything can be done.
Obviously you could parse log message with on-commit hook and make a notification of sorts re tickets of interest, but you'd need to have access to the server I guess.
You may find the Trac post-commit hook useful. It allows you to close tickets using your commit log messages. See the script here.

Resources